walnut.js/installer/sudo-cmd.sh

8 lines
200 B
Bash
Raw Normal View History

2017-11-07 11:15:02 +00:00
# Not every platform has or needs sudo, gotta save them O(1)s...
sudo_cmd=""
set +e
if type -p sudo >/dev/null 2>/dev/null; then
((EUID)) && [[ -z "${ANDROID_ROOT-}" ]] && sudo_cmd="sudo"
fi
set -e