-
Notifications
You must be signed in to change notification settings - Fork 586
Open
Description
Bug Description
The setup-ralph-loop.sh script fails with an unbound variable error when set -u (strict mode) is enabled and no prompt arguments are provided before options.
Error
PROMPT_PARTS[*]: unbound variable
Root Cause
Line 113 in scripts/setup-ralph-loop.sh:
PROMPT="${PROMPT_PARTS[*]}"When PROMPT_PARTS array is empty (e.g., when only options like --help are passed, or in certain edge cases), bash's strict mode (set -u on line 6) causes this to fail.
Fix
Change line 113 from:
PROMPT="${PROMPT_PARTS[*]}"To:
PROMPT="${PROMPT_PARTS[*]:-}"The :-} provides a default empty string when the array is empty, preventing the unbound variable error while maintaining strict mode for catching other bugs.
Environment
- macOS (Darwin 25.1.0)
- Bash (zsh-compatible)
- Claude Code CLI
Steps to Reproduce
- Install the ralph-loop plugin
- Run
/ralph-loop --helpor any command that might result in an empty PROMPT_PARTS array - Observe the unbound variable error
The fix is a one-line change that maintains backward compatibility.
Metadata
Metadata
Assignees
Labels
No labels