From c571066f6f14de39058027141f58019cb6969739 Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Mon, 2 Apr 2012 22:33:38 +0800 Subject: 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 --- src/sudo.bash | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/sudo.bash') 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 -- cgit v1.2.1