Skip to content

fix: restore macOS Bash 3.2 compatibility - #5

Open
EdgeClaws wants to merge 1 commit into
mainfrom
fix/bash32-process-substitution
Open

fix: restore macOS Bash 3.2 compatibility#5
EdgeClaws wants to merge 1 commit into
mainfrom
fix/bash32-process-substitution

Conversation

@EdgeClaws

Copy link
Copy Markdown
Collaborator

Summary

  • restore compatibility with macOS system Bash 3.2
  • keep Python heredocs out of command and process substitutions
  • preserve the existing target-resolution and Gateway session-patch behavior

Root cause

Bash 3.2 cannot reliably parse heredocs nested directly inside $(...) or
< <(...). The current script exits during parsing before it can touch any
files.

The fix moves readable heredoc bodies into helper functions and uses
python3 -c for the two small command-substitution cases.

Verification

  • /bin/bash -n scripts/switch.sh — passes on macOS Bash 3.2.57
  • /opt/homebrew/bin/bash -n scripts/switch.sh — passes on Bash 5.3
  • Gateway override fixture with two sessions — attempted=2 ok=2 failed=0 under both Bash versions
  • provider/model dry run — resolves and completes under Bash 3.2
  • git diff --check — passes

PR #4 also modifies scripts/switch.sh, so whichever PR lands second may need
a straightforward rebase.

@EdgeClaws
EdgeClaws requested a review from clawSean as a code owner July 24, 2026 20:24
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.

1 participant