gabriel / musehub public
fix BREAKING musehub#199 fix/199-push-sh-bash32-compat #1 / 1
AI Agent gabriel · 20 hours ago · Sep 11, 2026 · Diff

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]>

sha256:915b1f581ce1d3bca63153d03c07a5ccbbfbe77de3bf561e75e85f9427dd32a3 sha
+8 symbols
2 changed · 1075 in snapshot files
sha256:ad19b8dbc4a341b0ed5a3da084b7d7d1017a4b556529a1b4810b4ea79f2e1dd2 snapshot
+8
symbols added
2
files changed
1075
files in snapshot
0
dead code introduced
Semantic Changes 8 symbols
~ tests/test_deployment.py .py 8 symbols added
+ TestPushShBash32Compat class class TestPushShBash32Compat L444–511
+ test_env_helper_functions_resolve_correctly_under_bash_32 method method test_env_helper_functions_resolve_correctly_under_bash_32 L481–511
+ test_no_declare_a_in_push_sh method method test_no_declare_a_in_push_sh L452–457
+ test_usage_message_prints_under_real_bash_32 method method test_usage_message_prints_under_real_bash_32 L463–475
+ _PUSH_SH variable variable _PUSH_SH L28–28
+ _SYSTEM_BASH variable variable _SYSTEM_BASH L416–416
+ _extract_function function function _extract_function L437–441
+ _system_bash_major_version function function _system_bash_major_version L419–434
Files Changed
~2
1075 in snapshot
← Older Oldest on fix/199-push-sh-bash32-compat
All commits
Newer → Latest on fix/199-push-sh-bash32-compat

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:915b1f581ce1d3bca63153d03c07a5ccbbfbe77de3bf561e75e85f9427dd32a3 --body "your comment"