From 6355643ed68379bad585e35ef5b1eac60b2b48bb Mon Sep 17 00:00:00 2001 From: "dylan.araps@gmail.com" Date: Thu, 30 Jan 2020 08:52:25 +0000 Subject: kiss: Use as_root for git pulls FossilOrigin-Name: fa812b5811ca2dd56a7d606b6895adc7486ab65e0e5ac2ef0c7d1add1f948988 --- kiss | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'kiss') diff --git a/kiss b/kiss index 35816db..c02c031 100755 --- a/kiss +++ b/kiss @@ -53,8 +53,8 @@ as_root() { log "Using '${su:-su}'" case $su in - *sudo) sudo -u "${user:-root}" -E "$@" ;; - *doas) doas -u "${user:-root}" "$@" ;; + *sudo) sudo -u "${user:-root}" -E sh -c "$*" ;; + *doas) doas -u "${user:-root}" sh -c "$*" ;; *) su -pc "$* <&3" "${user:-root}" 3<&0 /dev/null; then - sudo git fetch - sudo git merge - elif command -v doas >/dev/null; then - doas git fetch - doas git merge - else - su -c 'git fetch && git merge' - fi + as_root 'git fetch && git merge' fi } done @@ -1142,8 +1134,8 @@ args() { *) case $@ in - *'*'*|*'!'*|*'['*|*']'*) - die "Arguments contain invalid characters: '!*[]'" + *'*'*|*'!'*|*'['*|*']'*|*' '*) + die "Arguments contain invalid characters: '!*[] '" ;; esac esac -- cgit v1.2.3