fix: context leak
This commit is contained in:
24
tests/nested_bazel_test.sh
Normal file
24
tests/nested_bazel_test.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
setup_nested_bazel_cmd() {
|
||||
if command -v bazel >/dev/null 2>&1; then
|
||||
bazel_cmd=(bazel)
|
||||
elif command -v bazelisk >/dev/null 2>&1; then
|
||||
bazel_cmd=(bazelisk)
|
||||
else
|
||||
echo "bazel or bazelisk is required on PATH" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
shutdown_nested_bazel_workspace() {
|
||||
local workspace_dir="${1:-}"
|
||||
if [[ -z ${workspace_dir} || ! -d ${workspace_dir} ]]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
(
|
||||
cd "${workspace_dir}"
|
||||
"${bazel_cmd[@]}" shutdown >/dev/null 2>&1
|
||||
) || true
|
||||
}
|
||||
Reference in New Issue
Block a user