mirror of
https://github.com/FluxaMedia/fluxa.git
synced 2026-07-26 20:02:14 +00:00
Fix follow-up bug from the bindgen_env unbound-variable patch
The \${arr[@]:-} default-value form avoids bash 3.2's unbound-variable
error on an empty array, but on macOS's stock bash it still expands to
a single empty-string word, so `env "" cargo build ...` tried to exec
an empty command name and failed with exit 127. Build the cargo
invocation as an array and only wrap it with `env` when bindgen_env
actually has entries, avoiding any [@] expansion of an empty array.
This commit is contained in:
parent
782b977e08
commit
c0da06c05d
1 changed files with 6 additions and 3 deletions
|
|
@ -59,10 +59,13 @@ build_rust_core() {
|
|||
fi
|
||||
fi
|
||||
|
||||
if [[ "$profile" == "Release" ]]; then
|
||||
env "${bindgen_env[@]:-}" cargo build --no-default-features --features ios "$@" --release
|
||||
local cargo_cmd=(cargo build --no-default-features --features ios "$@")
|
||||
[[ "$profile" == "Release" ]] && cargo_cmd+=(--release)
|
||||
|
||||
if [[ ${#bindgen_env[@]} -gt 0 ]]; then
|
||||
env "${bindgen_env[@]}" "${cargo_cmd[@]}"
|
||||
else
|
||||
env "${bindgen_env[@]:-}" cargo build --no-default-features --features ios "$@"
|
||||
"${cargo_cmd[@]}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue