summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2012-11-15 10:42:39 -0800
committerRob Pike <r@golang.org>2012-11-15 10:42:39 -0800
commitbd1a481960562122f32a45da459012ab9acf0397 (patch)
tree22183210d90932bd6b9466594f8ee3f288754582
parent4349ef898ebace50aaea10d7d25fa49d81a04db8 (diff)
downloadgo-bd1a481960562122f32a45da459012ab9acf0397.tar.gz
sudo.bash: diagnose when the go tool is not in $PATH
Fixes issue 4386. R=golang-dev, iant CC=golang-dev http://codereview.appspot.com/6854050
-rwxr-xr-xsrc/sudo.bash6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sudo.bash b/src/sudo.bash
index 40f8d1aa1..7b7d4f1cd 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