Fix install.sh for macOS Bash 3.2 compatibility#12
Fix install.sh for macOS Bash 3.2 compatibility#12vladimireduardo wants to merge 1 commit intoPhilipStark:masterfrom
Conversation
- Remove `pipefail` from `set -euo pipefail` — not supported in Bash 3.2 which ships with macOS (including Apple Silicon/M1). No pipes are used in the script, so `pipefail` was unnecessary. - Convert CRLF line endings to LF — Windows-style line endings cause `$'\r': command not found` errors on macOS/Linux. Tested on macOS 15 (Darwin 24.6.0) with Bash 3.2.57 on Apple M1. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
install.sh (1)
2-2: Restorepipefailusing a fallback pattern for Bash 3.2 compatibility.The current
set -euremovespipefail, which weakens error detection in pipeline operations. Sincepipefailwas introduced in Bash 3.0 and is available in Bash 3.2, use a conditional pattern to enable it safely across shells.Suggested pattern
set -eu +set -o pipefail 2>/dev/null || true🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@install.sh` at line 2, Replace the bare "set -eu" with a portable pattern that restores pipefail when supported: use "set -euo pipefail 2>/dev/null || set -eu" (or add that right after the existing "set -eu") so shells with pipefail enable it and older Bash versions fall back to the original flags; update the line containing "set -eu" accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@install.sh`:
- Line 5: The script header and summary lines currently contain a hardcoded "20
skills" string that can drift; change those static strings (the comment at the
top and the summary around lines 29-30) to use the same dynamic skill count
variable/command used later (the SKILL_COUNT or the find/grep count computed
near the code that prints the dynamic count at ~line 82) so the displayed number
is computed at runtime; update the two static messages to interpolate or format
with that computed count instead of the literal "20 skills".
---
Nitpick comments:
In `@install.sh`:
- Line 2: Replace the bare "set -eu" with a portable pattern that restores
pipefail when supported: use "set -euo pipefail 2>/dev/null || set -eu" (or add
that right after the existing "set -eu") so shells with pipefail enable it and
older Bash versions fall back to the original flags; update the line containing
"set -eu" accordingly.
| set -eu | ||
|
|
||
| # Book Genesis V4 — Installer for macOS/Linux | ||
| # Installs 20 skills + 1 agent + knowledge base to ~/.claude/ |
There was a problem hiding this comment.
Hardcoded “20 skills” text can drift from actual installs.
Line 5 and Line 29 are static, but Line 82 reports a dynamic count. This can mislead users when repo content changes (e.g., 21 skills).
Proposed patch
-# Installs 20 skills + 1 agent + knowledge base to ~/.claude/
+# Installs skills + 1 agent + knowledge base to ~/.claude/
@@
-echo -e "${YELLOW}Installing 20 skills + 1 agent + knowledge base${NC}"
+echo -e "${YELLOW}Installing skills + 1 agent + knowledge base${NC}"Also applies to: 29-30
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@install.sh` at line 5, The script header and summary lines currently contain
a hardcoded "20 skills" string that can drift; change those static strings (the
comment at the top and the summary around lines 29-30) to use the same dynamic
skill count variable/command used later (the SKILL_COUNT or the find/grep count
computed near the code that prints the dynamic count at ~line 82) so the
displayed number is computed at runtime; update the two static messages to
interpolate or format with that computed count instead of the literal "20
skills".
Summary
pipefailfromset -euo pipefail— not supported in Bash 3.2 (macOS default). No pipes in the script, so it was unnecessary.\r\ncauses$'\r': command not founderrors on macOS/Linux.Environment tested
Test plan
bash install.shon macOS M1 — installs all 21 skills + 1 agent + 5 knowledge files successfully🤖 Generated with Claude Code
Summary by CodeRabbit