fix: variables are hard

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

5
dot
View file

@ -19,8 +19,9 @@ 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=". $1 && super_$2" ecmd=". $1 && super_$2"
[ "$(id -u)" = "0" ] && sh -c "$cmd" || sudo sh -c "$cmd" [ "$(id -u)" = "0" ] && sh -c "$ecmd" || sudo sh -c "$ecmd"
unset ecmd
fi fi
is_function $2 && $2 is_function $2 && $2
} }