2009-11-14 16:29:09 -07:00
|
|
|
#!/usr/bin/env bash
|
2008-06-12 14:26:16 -06: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 13:27:19 -07:00
|
|
|
set -e
|
|
|
|
|
2015-08-05 11:39:07 -06: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 07:52:07 -07:00
|
|
|
|
2020-01-20 17:50:27 -07:00
|
|
|
gobin="${GOROOT}"/bin
|
2015-08-05 11:39:07 -06:00
|
|
|
if ! "$gobin"/go help >/dev/null 2>&1; then
|
|
|
|
echo 'cannot find go command; nothing to clean' >&2
|
2009-12-13 13:27:19 -07:00
|
|
|
exit 1
|
|
|
|
fi
|
2012-01-30 21:43:46 -07:00
|
|
|
|
2015-08-05 11:39:07 -06:00
|
|
|
"$gobin/go" clean -i std
|
|
|
|
"$gobin/go" tool dist clean
|
|
|
|
"$gobin/go" clean -i cmd
|