tools: fix comparison to see if sudo test is needed in install-*.sh (#6771)

The comparison to test if we were using sudo was failing when running as root. We would then run -v, and get a bad error message. fixing the comparison.
This commit is contained in:
Bryan Harmat 2018-05-01 13:35:19 -04:00 committed by Travis Plunk
parent 9ca059dcf8
commit 03b1f2bb99
3 changed files with 5 additions and 3 deletions

View file

@ -94,7 +94,7 @@ if (( $EUID != 0 )); then
fi
#Check that sudo is available
if [[ "$SUDO" -eq "sudo" && ! ("'$*'" =~ skip-sudo-check) ]]; then
if [[ "$SUDO" == "sudo" && ! ("'$*'" =~ skip-sudo-check) ]]; then
$SUDO -v
if [ $? -ne 0 ]; then

View file

@ -14,6 +14,7 @@
#Switches
# -includeide - the script is being run headless, do not perform actions that require response from the console
# -interactivetests - requires a human user in front of the machine - loads a script into the ide to test with F5 to ensure the IDE can run scripts
# -skip-sudo-check - skips the check that the user has permission to use sudo. This is required to run in the VSTS Hosted Linux Preview.
#gitrepo paths are overrideable to run from your own fork or branch for testing or private distribution
@ -96,7 +97,7 @@ if (( $EUID != 0 )); then
fi
#Check that sudo is available
if [[ "$SUDO" -ne "" ]]; then
if [[ "$SUDO" == "sudo" && ! ("'$*'" =~ skip-sudo-check) ]]; then
$SUDO -v
if [ $? -ne 0 ]; then

View file

@ -14,6 +14,7 @@
#Switches
# -includeide - the script is being run headless, do not perform actions that require response from the console
# -interactivetests - requires a human user in front of the machine - loads a script into the ide to test with F5 to ensure the IDE can run scripts
# -skip-sudo-check - skips the check that the user has permission to use sudo. This is required to run in the VSTS Hosted Linux Preview.
#gitrepo paths are overrideable to run from your own fork or branch for testing or private distribution
@ -94,7 +95,7 @@ if (( $EUID != 0 )); then
fi
#Check that sudo is available
if [[ "$SUDO" -eq "sudo" ]]; then
if [[ "$SUDO" == "sudo" && ! ("'$*'" =~ skip-sudo-check) ]]; then
$SUDO -v
if [ $? -ne 0 ]; then