pull-toolchain.sh 485 B

12345678910111213141516
  1. #!/bin/sh
  2. # Retrieve the latest Go toolchain.
  3. #
  4. set -eu
  5. cd "$(dirname "$0")"
  6. read -r go_branch <go.toolchain.branch
  7. upstream=$(git ls-remote https://github.com/tailscale/go "$go_branch" | awk '{print $1}')
  8. current=$(cat go.toolchain.rev)
  9. if [ "$upstream" != "$current" ]; then
  10. echo "$upstream" >go.toolchain.rev
  11. fi
  12. if [ -n "$(git diff-index --name-only HEAD -- go.toolchain.rev)" ]; then
  13. echo "pull-toolchain.sh: changes imported. Use git commit to make them permanent." >&2
  14. fi