forked from kiss-community/kiss
kiss: Use as_root for git pulls
This commit is contained in:
parent
fa1538fb13
commit
f8d35ce2b5
18
kiss
18
kiss
@ -53,8 +53,8 @@ as_root() {
|
|||||||
log "Using '${su:-su}'"
|
log "Using '${su:-su}'"
|
||||||
|
|
||||||
case $su in
|
case $su in
|
||||||
*sudo) sudo -u "${user:-root}" -E "$@" ;;
|
*sudo) sudo -u "${user:-root}" -E sh -c "$*" ;;
|
||||||
*doas) doas -u "${user:-root}" "$@" ;;
|
*doas) doas -u "${user:-root}" sh -c "$*" ;;
|
||||||
*) su -pc "$* <&3" "${user:-root}" 3<&0 </dev/tty ;;
|
*) su -pc "$* <&3" "${user:-root}" 3<&0 </dev/tty ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@ -1038,15 +1038,7 @@ pkg_updates() {
|
|||||||
else
|
else
|
||||||
log "$PWD" "Need root to update"
|
log "$PWD" "Need root to update"
|
||||||
|
|
||||||
if command -v sudo >/dev/null; then
|
as_root 'git fetch && git merge'
|
||||||
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
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
done
|
done
|
||||||
@ -1142,8 +1134,8 @@ args() {
|
|||||||
|
|
||||||
*)
|
*)
|
||||||
case $@ in
|
case $@ in
|
||||||
*'*'*|*'!'*|*'['*|*']'*)
|
*'*'*|*'!'*|*'['*|*']'*|*' '*)
|
||||||
die "Arguments contain invalid characters: '!*[]'"
|
die "Arguments contain invalid characters: '!*[] '"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
esac
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user