bazel: improve script template resilience

Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
Paul Meyer 2023-03-29 14:13:26 +02:00
parent 909bfb9274
commit d7fafb92b7
13 changed files with 122 additions and 32 deletions

View file

@ -1,8 +1,9 @@
#!/usr/bin/env bash
###### script header ######
lib=$(realpath @@BASE_LIB@@) || exit 1
go=$(realpath @@GO@@) || exit 1
govulncheck=$(realpath @@GOVULNCHECK@@) || exit 1
stat "${lib}" >> /dev/null || exit 1
# shellcheck source=../sh/lib.bash
if ! source "${lib}"; then
@ -10,7 +11,14 @@ if ! source "${lib}"; then
exit 1
fi
cd "${BUILD_WORKSPACE_DIRECTORY}" || exit 1
go=$(realpath @@GO@@)
stat "${go}" >> /dev/null
govulncheck=$(realpath @@GOVULNCHECK@@)
stat "${govulncheck}" >> /dev/null
cd "${BUILD_WORKSPACE_DIRECTORY}"
###### script body ######
submodules=$(${go} list -f '{{.Dir}}' -m)