mirror of
https://github.com/bazel-contrib/bazel-lib
synced 2024-11-27 17:43:27 +00:00
fb0677ad57
* chore: clenaup before bazel-contrib handoff * chore: apply lint fixes --------- Co-authored-by: Alex Eagle <alex@aspect.dev>
14 lines
533 B
Bash
Executable file
14 lines
533 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -o nounset
|
|
|
|
# Snippet to parse Bazel's status file format.
|
|
# https://github.com/bazelbuild/bazel/issues/11164#issuecomment-996186921
|
|
# is another option, which requires Bash 4 for associative arrays.
|
|
while IFS= read -r line; do
|
|
read key value <<<"$line"
|
|
declare "$key"="$value"
|
|
done < <(cat "${BAZEL_STABLE_STATUS_FILE:-/dev/null}" "${BAZEL_VOLATILE_STATUS_FILE:-/dev/null}")
|
|
|
|
# A real program would do something useful with the stamp info, like pass it to a linker.
|
|
echo "${BUILD_USER:-unstamped}" >"$1"
|