| #!/usr/bin/env bash |
| # Copyright 2024 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| set -eu -o pipefail |
| |
| tempdir="$(mktemp -d)" |
| |
| echo "Installing go..." |
| cipd ensure -log-level warning -root "${tempdir}" -ensure-file - <<EOF |
| infra/3pp/tools/go/\${platform} latest |
| EOF |
| go="${tempdir}/bin/go" |
| |
| "$go" get -u -t ./... |
| "$go" mod tidy |
| "$go" mod vendor |
| |
| # The run_script.py recipe sets this environment variable to allow scripts to |
| # set their own commit messages. |
| if [ -n "${COMMIT_MESSAGE_FILE+x}" ]; then |
| { |
| echo "[go.mod] Update Go dependencies" |
| echo "" |
| echo "Generated by scripts/update-deps.sh." |
| } > "$COMMIT_MESSAGE_FILE" |
| fi |