pull-toolchain.sh 635 B

1234567891011121314151617181920
  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. ./tool/go version 2>/dev/null | awk '{print $3}' | sed 's/^go//' > go.toolchain.version
  13. ./update-flake.sh
  14. if [ -n "$(git diff-index --name-only HEAD -- go.toolchain.rev go.toolchain.rev.sri go.toolchain.version)" ]; then
  15. echo "pull-toolchain.sh: changes imported. Use git commit to make them permanent." >&2
  16. fi