| # Copyright 2021 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. |
| # This file will be run by `go test`. |
| # See all_test.go in this directory. |
| # Ensure that installed go binaries are on the path. |
| # This bash expression follows the algorithm described at the top of |
| # `go install help`: first try $GOBIN, then $GOPATH/bin, then $HOME/go/bin. |
| go_install_dir=${GOBIN:-${GOPATH:-$HOME/go}/bin} |
| PATH=$PATH:$go_install_dir |
| # check_shellcheck runs shellcheck on .bash and .sh files. |
| if ! [ -x "$(command -v shellcheck)" ]; then |
| echo "Please install shellcheck. See https://github.com/koalaman/shellcheck#installing." |
| runcmd shellcheck -x checks.bash |
| runcmd shellcheck ./**/*.sh |
| # runchecks runs all checks and is intended to run as a precommit hook. |
| # These checks only run locally due to a limitation with TryBots. |
| # trybots runs checks supported by TryBots. |
| help - display this help message |
| "-h" | "--help" | "help") |
| if [[ "$EXIT_CODE" != 0 ]]; then |
| err "FAILED; see errors above" |