fix(musehub#199): remove declare -A from push.sh for bash 3.2 compat
Root cause: push.sh used declare -A (associative arrays) for its per-environment INSTANCE/ECR_REGISTRY/AWS_PROFILE lookup tables, with no version guard. Associative arrays require bash 4+; macOS ships bash 3.2 as /bin/bash with no upgrade path short of Homebrew, so anyone running push.sh under the system bash hit 'unbound variable' at the very first array reference before the script did anything useful.
Fix: replaced all three associative arrays with case-dispatch helper functions (instance_id_for/ecr_registry_for/aws_profile_for). This avoids the bash-version dependency entirely rather than gating on it -- no minimum bash version is required at all, so there's nothing for a user to install.
Tests: new TestPushShBash32Compat in tests/test_deployment.py. Reproduced the reported crash for real against the actual macOS system bash (/bin/bash, confirmed 3.2.57 on this machine) before the fix, confirmed the usage message now prints cleanly after it, and confirmed the replacement helper functions resolve the exact same values the old arrays held. Full tests/test_deployment.py sweep: 37 passed.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Semantic Changes
8 symbols
Files Changed
~2
1075 in snapshot
0 comments
muse hub commit comment sha256:915b1f581ce1d3bca63153d03c07a5ccbbfbe77de3bf561e75e85f9427dd32a3 --body "your comment"
No comments yet. Be the first to start the discussion.