summaryrefslogtreecommitdiff
path: root/src/sudo.bash
diff options
context:
space:
mode:
authorShenghou Ma <minux.ma@gmail.com>2012-04-02 22:33:38 +0800
committerShenghou Ma <minux.ma@gmail.com>2012-04-02 22:33:38 +0800
commitc571066f6f14de39058027141f58019cb6969739 (patch)
tree5f40398f037b192fa5680d3a828b84f257e074e5 /src/sudo.bash
parent9286aa6793065659a9dae3b588523b93ce354c18 (diff)
downloadgo-c571066f6f14de39058027141f58019cb6969739.tar.gz
cmd/dist, sudo.bash: don't mention sudo.bash if cov or prof is not present
Fixes issue 3422. R=golang-dev, rsc CC=golang-dev http://codereview.appspot.com/5967057
Diffstat (limited to 'src/sudo.bash')
-rwxr-xr-xsrc/sudo.bash7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/sudo.bash b/src/sudo.bash
index cccebd342..40f8d1aa1 100755
--- a/src/sudo.bash
+++ b/src/sudo.bash
@@ -12,12 +12,17 @@ Darwin)
exit 0
esac
+eval $(go env)
+if ! [ -x $GOTOOLDIR/cov -a -x $GOTOOLDIR/prof ]; then
+ echo "You don't need to run sudo.bash." >&2
+ exit 2
+fi
+
if [[ ! -d /usr/local/bin ]]; then
echo 1>&2 'sudo.bash: problem with /usr/local/bin; cannot install tools.'
exit 2
fi
-eval $(go env)
cd $(dirname $0)
for i in prof cov
do