From 7e7e23be36c2ec3670f24e55d20ef9ff1ffb551c Mon Sep 17 00:00:00 2001 From: pancake Date: Mon, 15 May 2017 15:36:37 +0200 Subject: [PATCH] Properly honor NOSUDO --- sys/install.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/install.sh b/sys/install.sh index ce0f649e10d39..533610f4e70b0 100755 --- a/sys/install.sh +++ b/sys/install.sh @@ -30,10 +30,14 @@ else shift fi -NOSUDO="" -type sudo > /dev/null 2>&1 || NOSUDO=1 -SUDO=sudo -[ -n "${NOSUDO}" ] && SUDO= +export NOSUDO +if [ -n "${NOSUDO}" ]; then + SUDO="" +else + type sudo > /dev/null 2>&1 || NOSUDO=1 + SUDO=sudo + [ -n "${NOSUDO}" ] && SUDO= +fi if [ "$(id -u)" = 0 ]; then SUDO=""