fix: shell

This commit is contained in:
Strix 2023-11-19 01:12:59 +01:00
parent 11d5c2f3e2
commit 0e0bdb4aef
No known key found for this signature in database
GPG key ID: 5F35B3B8537287A7

4
dot
View file

@ -19,8 +19,8 @@ include() {
func() { func() {
if is_function $(echo "super_$2"); then if is_function $(echo "super_$2"); then
[ "${DO_SUDO:-yes}" = "yes" ] || return 0 [ "${DO_SUDO:-yes}" = "yes" ] || return 0
cmd="sh -c \". $1 && super_$2\"" cmd=". $1 && super_$2"
[ "$(id -u)" = "0" ] && $cmd || sudo $cmd [ "$(id -u)" = "0" ] && sh -c "$cmd" || sudo sh -c "$cmd"
fi fi
is_function $2 && $2 is_function $2 && $2
} }