fix: invoke CLI installer with bash instead of sh#1260
Conversation
The CLI install script uses `set -o pipefail` which requires bash. When the engine installer invoked it via `sh`, dash (the default sh on Ubuntu/Debian) rejected the option with "Illegal option -o pipefail".
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThe CLI installer invocation in the installation script is updated to execute using bash instead of sh across both conditional branches (when INSTALL_DIR is set and when it is not set). Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
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)
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.
🧹 Nitpick comments (1)
engine/install.sh (1)
13-16: Consider adding a bash availability check for clearer error messaging.If
bashis not installed on the target system, the error message would be a generic "command not found" rather than a clear diagnostic. Adding an early check ininstall_cliwould improve the user experience on minimal systems.💡 Suggested improvement
install_cli() { echo "" echo "installing iii cli..." + + if ! command -v bash >/dev/null 2>&1; then + echo "warning: bash is required for CLI installation, skipping" >&2 + return 1 + fi cli_tmpdir=$(mktemp -d 2>/dev/null || mktemp -d -t iii-cli-install)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@engine/install.sh` around lines 13 - 16, The install_cli function should first verify bash is available and fail with a clear message if not; add an early check in install_cli (e.g., using command -v bash or type bash >/dev/null 2>&1) and if the check fails call echo with a helpful diagnostic like "bash is required to install the iii cli" and exit 1, ensuring the rest of install_cli only runs when bash is present.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@engine/install.sh`:
- Around line 13-16: The install_cli function should first verify bash is
available and fail with a clear message if not; add an early check in
install_cli (e.g., using command -v bash or type bash >/dev/null 2>&1) and if
the check fails call echo with a helpful diagnostic like "bash is required to
install the iii cli" and exit 1, ensuring the rest of install_cli only runs when
bash is present.
Summary
sh, but the CLI script usesset -o pipefail(a bash feature)shisdash, this fails with:Illegal option -o pipefailbashinstead ofshto invoke the CLI installerThis was the second fix from #1259 that was lost during squash merge.
Test plan
curl -fsSL https://install.iii.dev/iii/main/install.sh | shon Ubuntu and verify CLI installs without "Illegal option" errorSummary by CodeRabbit