From: Rob Pike Date: Thu, 15 Nov 2012 18:42:39 +0000 (-0800) Subject: sudo.bash: diagnose when the go tool is not in $PATH X-Git-Tag: go1.1rc2~1863 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c590db2b8b9d72492d5a5269f19a105e9614369b;p=gostls13.git sudo.bash: diagnose when the go tool is not in $PATH Fixes #4386. R=golang-dev, iant CC=golang-dev https://golang.org/cl/6854050 --- diff --git a/src/sudo.bash b/src/sudo.bash index 40f8d1aa19..7b7d4f1cdd 100755 --- a/src/sudo.bash +++ b/src/sudo.bash @@ -12,6 +12,12 @@ Darwin) exit 0 esac +# Check that the go command exists +if ! go help >/dev/null 2>&1; then + echo "The go command is not in your PATH." >&2 + exit 2 +fi + eval $(go env) if ! [ -x $GOTOOLDIR/cov -a -x $GOTOOLDIR/prof ]; then echo "You don't need to run sudo.bash." >&2