constellation/bazel/ci/tidy.sh
Paul Meyer cc60de312e ci: adopt tidy workflow for bazel
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
2023-03-10 10:02:28 -05:00

24 lines
482 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
shopt -s inherit_errexit
# shellcheck disable=SC2153
gazelle=$(realpath "${GAZELLE}")
go=$(realpath "${GO}")
cd "${BUILD_WORKSPACE_DIRECTORY}"
submodules=$(${go} list -f '{{.Dir}}' -m)
for mod in ${submodules}; do
${go} mod tidy -C "${mod}"
done
${gazelle} update-repos \
-from_file=go.work \
-to_macro=toolchains/go_module_deps.bzl%go_dependencies \
-build_file_proto_mode=disable_global \
-build_file_generation=on \
-prune