Skip to content

Commit

Permalink
Fix unbound variable error on macOS.
Browse files Browse the repository at this point in the history
Apparently macOS's version of bash doesn't handle empty arrays well.

Part of bazelbuild#134.
  • Loading branch information
katre committed Sep 12, 2023
1 parent 7155b29 commit ed1ec19
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/rules/android_sdk_repository/android_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,12 @@ EOF
}

function check_android_sdk_provider() {
local extra_args=("$@")
local extra_args=(
# macOS bash doesn't deal well with empty arrays, so make sure this has
# contents.
"--experimental_google_legacy_api"
"$@"
)

if [[ ${ENABLE_PLATFORMS:-false} == "true" ]]; then
write_platforms
Expand All @@ -245,7 +250,6 @@ EOF

"${BIT_BAZEL_BINARY}" \
build \
--experimental_google_legacy_api \
"${extra_args[@]}" \
-- \
//sdk_check:check >& $TEST_log || fail "Expected success"
Expand Down

0 comments on commit ed1ec19

Please sign in to comment.