diff options
author | Christopher Wedgwood <cw@f00f.org> | 2009-12-13 12:27:19 -0800 |
---|---|---|
committer | Christopher Wedgwood <cw@f00f.org> | 2009-12-13 12:27:19 -0800 |
commit | 4a1dc14dabaee0d29e13736cf255dfb5a1736f80 (patch) | |
tree | 96e4081f04465804da630606dc365732eb4614a7 /src/clean.bash | |
parent | da32f2130d625d1ad9c21389225c8a1c3fbdd291 (diff) | |
download | golang-4a1dc14dabaee0d29e13736cf255dfb5a1736f80.tar.gz |
clean.bash: stop if $GOROOT is not set
Doing rm -rf /pkg/.. blindly isn't nice. It could have
unintended consequences.
Secondly set bash to abort on (unexpected) errors.
R=dho, rsc
CC=golang-dev
http://codereview.appspot.com/176056
Committer: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/clean.bash')
-rwxr-xr-x | src/clean.bash | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/clean.bash b/src/clean.bash index 3687244b2..90bad1f5f 100755 --- a/src/clean.bash +++ b/src/clean.bash @@ -3,6 +3,13 @@ # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. +set -e + +if [ -z "$GOROOT" ] ; then + echo '$GOROOT not set' + exit 1 +fi + GOBIN="${GOBIN:-$HOME/bin}" rm -rf "$GOROOT"/pkg/${GOOS}_$GOARCH |