fix os detection on macOS with bash 3.2#28
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe pull request replaces Bash parameter expansion-based lowercasing with external Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Comment |
|
My default shell is set to zsh too. I never encountered the issue you describe. |
I believe it's actually an old bash combat problem. I'm on macOS and had whatever it came shipped with bash 3.2. Applied the <<< suggestion too, thanks. I'll update the PR and amend the commit |
macOS ships
/bin/bash3.2.57 which doesn't support${os,,}(added in bash 4.0). When/usr/bin/env bashresolves to the system bash,is_macos()andis_linux()silently fail withbad substitution, soget_child_cmdsnever takes the macOS code path and SSH detection breaks — the split just opens a local shell.Replace
${os,,}withtr '[:upper:]' '[:lower:]' <<< "$os"which works on all bash versions.