From c7957ac270b65e8c92cc3723b5b607f83056a3f4 Mon Sep 17 00:00:00 2001 From: Raine Date: Sun, 19 Nov 2023 01:17:17 +0100 Subject: [PATCH] fix: variables are hard --- dot | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dot b/dot index ed8b427..17ee37d 100755 --- a/dot +++ b/dot @@ -19,8 +19,9 @@ include() { func() { if is_function $(echo "super_$2"); then [ "${DO_SUDO:-yes}" = "yes" ] || return 0 - cmd=". $1 && super_$2" - [ "$(id -u)" = "0" ] && sh -c "$cmd" || sudo sh -c "$cmd" + ecmd=". $1 && super_$2" + [ "$(id -u)" = "0" ] && sh -c "$ecmd" || sudo sh -c "$ecmd" + unset ecmd fi is_function $2 && $2 }