Skip to content

Commit

Permalink
Properly honor NOSUDO
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed May 15, 2017
1 parent a059631 commit 7e7e23b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions sys/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand Down

0 comments on commit 7e7e23b

Please sign in to comment.