fix: variables are hard
This commit is contained in:
parent
0e0bdb4aef
commit
c7957ac270
1 changed files with 3 additions and 2 deletions
5
dot
5
dot
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue