Repository navigation
Fix installer abort on macOS bash 3.2 fresh install - #27
Open
mahdi-salmanzade wants to merge 1 commit into
Open
mahdi-salmanzade wants to merge 1 commit into
mahdi-salmanzade wants to merge 1 commit into
Conversation
install.sh runs under `set -u` and is documented to be piped into
/bin/bash, which on macOS is 3.2.57. In that shell, expanding an empty
array as "${patch_arguments[@]}" is an unbound-variable error rather
than an empty expansion, so a first-time install aborted at the patcher
invocation:
install.sh: line 137: patch_arguments[@]: unbound variable
The array is only populated with --force when a previous installation
is present, so the failure hit exactly the fresh-install path.
Use the ${arr[@]+"${arr[@]}"} expansion, which is empty-safe on bash 3.2
and still forwards --force unchanged on a reinstall.
Verified on macOS 26.6.2 with GNU bash 3.2.57(1)-release, stubbing the
build steps: fresh install now invokes the patcher with no extra
arguments, and an existing installation still invokes it with --force.
Note that `npm run check:shell` is `bash -n install.sh`, a parse-only
check, so it cannot catch this class of runtime error.
Fixes b-nnett#16
Claude-Session: https://claude.ai/code/session_01RkmFsKx3RanHavCx7Xzy6c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The documented one-command install fails on a clean machine.
Problem
install.shusesset -uand the README pipes it into/bin/bash, which on macOS is3.2.57. In that shell, expanding an empty array as"${patch_arguments[@]}"is an unbound variable error rather than an empty expansion:patch_argumentsonly receives--forcewhen a previous installation exists, so the array is empty precisely on the fresh-install path — the first thing a new user runs.This is issue #16.
Fix
One line, using the empty-safe expansion:
${arr[@]+"${arr[@]}"}expands to nothing when the array is empty and otherwise forwards every element quoted, so--forcebehaviour is unchanged.Verification
macOS 26.6.2,
GNU bash 3.2.57(1)-release (arm64-apple-darwin25), running the realinstall.shwith the build steps stubbed:unbound variable, exit 1--forceRepository checks pass:
check:shell,check:python,release:check.One note for maintainers
npm run check:shellisbash -n install.sh, which is parse-only. Aset -uunbound-variable error is a runtime failure, so CI structurally cannot catch this class of bug — which is how it shipped. I kept this PR to the one-line fix per CONTRIBUTING, but you may want a smoke invocation under/bin/bashin CI. Happy to add it here or separately if useful.🤖 Generated with Claude Code
https://claude.ai/code/session_01RkmFsKx3RanHavCx7Xzy6c