diff --git a/dot b/dot index 2bb2b0f..398ca9f 100755 --- a/dot +++ b/dot @@ -19,7 +19,8 @@ include() { func() { if is_function $(echo "super_$2"); then [ "${DO_SUDO:-yes}" = "yes" ] || return 0 - sudo sh -c ". $1 && super_$2" + cmd="sh -c \". $1 && super_$2\"" + [ "$(id -u)" = "0" ] && $cmd || sudo $cmd fi is_function $2 && $2 }