Update setup.bash to use portable `$sudo_cmd` syntax

This commit is contained in:
richdex14 2017-09-04 12:18:57 -06:00
parent 351056f9bc
commit a24f92df98
1 changed files with 5 additions and 1 deletions

View File

@ -12,6 +12,10 @@
# curl -fsSL https://example.com/setup-min.bash | bash
# wget -nv https://example.com/setup-min.bash -O - | bash
# Not every platform has or needs sudo, gotta save them O(1)s...
sudo_cmd=""
((EUID)) && [[ -z "$ANDROID_ROOT" ]] && sudo_cmd="sudo"
dont_install_deps="$1"
set -e
set -u
@ -287,7 +291,7 @@ if [ -n "${NODEJS_VER}" ]; then
bash "/tmp/${INSTALL_FILE}" "${NODEJS_VER}"
fi
sudo chown -R $(whoami) $node_install_path/lib/node_modules
$sudo_cmd chown -R $(whoami) $node_install_path/lib/node_modules
echo ""