mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-01-12 07:59:29 -05:00
bazel: don't exit early in workspace_status.sh (#1713)
This commit is contained in:
parent
e9103cad0a
commit
6027b066e5
@ -29,26 +29,31 @@ goarch() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
ensure_pseudo_version_tool() {
|
need_pseudo_version_tool() {
|
||||||
if [[ ! -f "${REPOSITORY_ROOT}/tools/pseudo-version" ]]; then
|
if [[ ! -f "${REPOSITORY_ROOT}/tools/pseudo-version" ]]; then
|
||||||
get_pseudo_version_tool
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
expected=$(cat "${REPOSITORY_ROOT}/tools/pseudo_version_$(goos)_$(goarch).sha256")
|
expected=$(cat "${REPOSITORY_ROOT}/tools/pseudo_version_$(goos)_$(goarch).sha256")
|
||||||
|
|
||||||
local need_pseudo_version_tool=0
|
local need_pseudo_version_tool=0
|
||||||
if type sha256sum > /dev/null 2>&1; then
|
if type sha256sum > /dev/null 2>&1; then
|
||||||
sha256sum -c --status <(echo "${expected} ${REPOSITORY_ROOT}/tools/pseudo-version")
|
need_pseudo_version_tool=$(sha256sum -c --status <(echo "${expected} ${REPOSITORY_ROOT}/tools/pseudo-version") && echo 0 || echo 1)
|
||||||
need_pseudo_version_tool=$?
|
|
||||||
elif type shasum > /dev/null 2>&1; then
|
elif type shasum > /dev/null 2>&1; then
|
||||||
shasum -a 256 -c --status <(echo "${expected} ${REPOSITORY_ROOT}/tools/pseudo-version")
|
need_pseudo_version_tool=$(shasum -a 256 -c --status <(echo "${expected} ${REPOSITORY_ROOT}/tools/pseudo-version") && echo 0 || echo 1)
|
||||||
need_pseudo_version_tool=$?
|
|
||||||
else
|
else
|
||||||
echo "sha256sum or shasum is required to verify the pseudo-version tool" >&2
|
echo "sha256sum or shasum is required to verify the pseudo-version tool" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${need_pseudo_version_tool} -ne 0 ]]; then
|
return "${need_pseudo_version_tool}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# shellcheck disable=SC2310
|
||||||
|
ensure_pseudo_version_tool() {
|
||||||
|
local should_download=0
|
||||||
|
should_download=$(need_pseudo_version_tool && echo 0 || echo 1)
|
||||||
|
|
||||||
|
if [[ ${should_download} -ne 0 ]]; then
|
||||||
get_pseudo_version_tool
|
get_pseudo_version_tool
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user