diff --git a/scripts/get b/scripts/get index 777a53bbc..a8ec3c6d9 100755 --- a/scripts/get +++ b/scripts/get @@ -50,13 +50,11 @@ initOS() { # runs the given command as root (detects if we are root already) runAsRoot() { - local CMD="$*" - - if [ $EUID -ne 0 -a $USE_SUDO = "true" ]; then - CMD="sudo $CMD" + if [ $EUID -ne 0 -a "$USE_SUDO" = "true" ]; then + sudo "${@}" + else + "${@}" fi - - $CMD } # verifySupported checks that the os/arch combination is supported for diff --git a/scripts/get-helm-3 b/scripts/get-helm-3 index 7afa9bae9..97ebe2435 100755 --- a/scripts/get-helm-3 +++ b/scripts/get-helm-3 @@ -57,13 +57,11 @@ initOS() { # runs the given command as root (detects if we are root already) runAsRoot() { - local CMD="$*" - - if [ $EUID -ne 0 -a $USE_SUDO = "true" ]; then - CMD="sudo $CMD" + if [ $EUID -ne 0 -a "$USE_SUDO" = "true" ]; then + sudo "${@}" + else + "${@}" fi - - $CMD } # verifySupported checks that the os/arch combination is supported for