2009-11-14 15:29:09 -08:00
|
|
|
#!/usr/bin/env bash
|
2008-06-12 13:26:16 -07:00
|
|
|
# Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
|
# Use of this source code is governed by a BSD-style
|
|
|
|
|
# license that can be found in the LICENSE file.
|
|
|
|
|
|
2009-12-13 12:27:19 -08:00
|
|
|
set -e
|
|
|
|
|
|
2015-08-05 13:39:07 -04:00
|
|
|
if [ ! -f run.bash ]; then
|
|
|
|
|
echo 'clean.bash must be run from $GOROOT/src' 1>&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
export GOROOT="$(cd .. && pwd)"
|
2012-02-15 23:52:07 +09:00
|
|
|
|
2015-08-05 13:39:07 -04:00
|
|
|
gobin="${GOBIN:-../bin}"
|
|
|
|
|
if ! "$gobin"/go help >/dev/null 2>&1; then
|
|
|
|
|
echo 'cannot find go command; nothing to clean' >&2
|
2009-12-13 12:27:19 -08:00
|
|
|
exit 1
|
|
|
|
|
fi
|
2012-01-30 23:43:46 -05:00
|
|
|
|
2015-08-05 13:39:07 -04:00
|
|
|
"$gobin/go" clean -i std
|
|
|
|
|
"$gobin/go" tool dist clean
|
|
|
|
|
"$gobin/go" clean -i cmd
|