Text file src/clean.bash

Documentation: Index

     1#!/usr/bin/env bash
     2# Copyright 2009 The Go Authors. All rights reserved.
     3# Use of this source code is governed by a BSD-style
     4# license that can be found in the LICENSE file.
     5
     6set -e
     7
     8if [ ! -f run.bash ]; then
     9	echo 'clean.bash must be run from $GOROOT/src' 1>&2
    10	exit 1
    11fi
    12export GOROOT="$(cd .. && pwd)"
    13
    14gobin="${GOBIN:-../bin}"
    15if ! "$gobin"/go help >/dev/null 2>&1; then
    16	echo 'cannot find go command; nothing to clean' >&2
    17	exit 1
    18fi
    19
    20"$gobin/go" clean -i std
    21"$gobin/go" tool dist clean
    22"$gobin/go" clean -i cmd

View as plain text