Skip to content

scripts: fix empty-array unbound variable error on bash 3.x (macOS)#3

Merged
edcdavid merged 1 commit into
mainfrom
fix-for-macos
May 28, 2026
Merged

scripts: fix empty-array unbound variable error on bash 3.x (macOS)#3
edcdavid merged 1 commit into
mainfrom
fix-for-macos

Conversation

@bnshr
Copy link
Copy Markdown
Contributor

@bnshr bnshr commented May 28, 2026

macOS ships bash 3.2, which treats "${ARGS[@]}" on an empty array as an unbound variable when set -u is active.

On macOS, bash 3.2 treats "${ARGS[@]}" as an unbound variable when the
array is empty and set -u (nounset) is active.  Replace both expansions
in setup-utm-ubuntu.sh with the ${ARGS[@]+"${ARGS[@]}"} idiom, which
expands only when the array is non-empty and is safe under set -u on all
bash versions.

Co-authored-by: Cursor <cursoragent@cursor.com>
@bnshr bnshr changed the title Fix for the run on macOS scripts: fix empty-array unbound variable error on bash 3.x (macOS) May 28, 2026
@edcdavid edcdavid merged commit 664b2ce into main May 28, 2026
4 checks passed
@bnshr bnshr deleted the fix-for-macos branch May 28, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants