go.fuchsia.dev/infra@v0.0.0-20240507153436-9b593402251b/scripts/update-deps.sh (about) 1 #!/usr/bin/env bash 2 # Copyright 2024 The Fuchsia Authors. All rights reserved. 3 # Use of this source code is governed by a BSD-style license that can be 4 # found in the LICENSE file. 5 6 set -eu -o pipefail 7 8 tempdir="$(mktemp -d)" 9 10 echo "Installing go..." 11 cipd ensure -log-level warning -root "${tempdir}" -ensure-file - <<EOF 12 infra/3pp/tools/go/\${platform} latest 13 EOF 14 go="${tempdir}/bin/go" 15 16 "$go" get -u -t ./... 17 "$go" mod tidy 18 "$go" mod vendor 19 20 # The run_script.py recipe sets this environment variable to allow scripts to 21 # set their own commit messages. 22 if [ -n "${COMMIT_MESSAGE_FILE+x}" ]; then 23 { 24 echo "[go.mod] Update Go dependencies" 25 echo "" 26 echo "Generated by scripts/update-deps.sh." 27 } > "$COMMIT_MESSAGE_FILE" 28 fi