spec-kit
spec-kit copied to clipboard
fix: bash 3.2 compatibility in create-new-feature.sh (${word^^} bad substitution on macOS)
Problem
scripts/bash/create-new-feature.sh uses ${word^^} (bash 4+ uppercase parameter expansion) on line 155. macOS ships with bash 3.2 by default, where this syntax fails:
create-new-feature.sh: line 155: \b${word^^}\b: bad substitution
The error is printed (4× for a multi-word description) and the elif branch is silently skipped, so the acronym-preservation logic stops working — short uppercase words like API get dropped from the generated branch name.
Reproduction (macOS, bash 3.2)
bash scripts/bash/create-new-feature.sh --json "Integrate API for posts"
# -> create-new-feature.sh: line 155: \b${word^^}\b: bad substitution
Fix
Replace ${word^^} with $(echo "$word" | tr '[:lower:]' '[:upper:]') — POSIX-compatible, works on bash 3.2 and 4+.
After the fix, no errors are printed and the acronym is correctly preserved in the branch name (e.g. 002-integrate-api-for-posts).
Notes
- Single-line change, no behavior change on bash 4+.
- Verified there are no other
${var^^}/${var,,}usages underscripts/bash/.
Please address Copilot feedback