fix: replace echo with printf in shell snippets to prevent jq parse errors
zsh's built-in echo interprets \n escape sequences in JSON strings, converting properly-escaped \\n back into literal newlines. This breaks jq parsing with "control characters U+0000 through U+001F must be escaped". printf '%s\n' preserves the JSON verbatim. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -66,7 +66,7 @@ Find highest existing phase:
|
||||
```bash
|
||||
# Get sorted phase list, extract last one
|
||||
PHASES=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" phases list)
|
||||
HIGHEST=$(echo "$PHASES" | jq -r '.directories[-1]')
|
||||
HIGHEST=$(printf '%s\n' "$PHASES" | jq -r '.directories[-1]')
|
||||
```
|
||||
|
||||
New phases continue from there:
|
||||
|
||||
@@ -257,13 +257,13 @@ ls "${PHASE_DIR}"/*-PLAN.md 2>/dev/null
|
||||
Extract from INIT JSON:
|
||||
|
||||
```bash
|
||||
STATE_PATH=$(echo "$INIT" | jq -r '.state_path // empty')
|
||||
ROADMAP_PATH=$(echo "$INIT" | jq -r '.roadmap_path // empty')
|
||||
REQUIREMENTS_PATH=$(echo "$INIT" | jq -r '.requirements_path // empty')
|
||||
RESEARCH_PATH=$(echo "$INIT" | jq -r '.research_path // empty')
|
||||
VERIFICATION_PATH=$(echo "$INIT" | jq -r '.verification_path // empty')
|
||||
UAT_PATH=$(echo "$INIT" | jq -r '.uat_path // empty')
|
||||
CONTEXT_PATH=$(echo "$INIT" | jq -r '.context_path // empty')
|
||||
STATE_PATH=$(printf '%s\n' "$INIT" | jq -r '.state_path // empty')
|
||||
ROADMAP_PATH=$(printf '%s\n' "$INIT" | jq -r '.roadmap_path // empty')
|
||||
REQUIREMENTS_PATH=$(printf '%s\n' "$INIT" | jq -r '.requirements_path // empty')
|
||||
RESEARCH_PATH=$(printf '%s\n' "$INIT" | jq -r '.research_path // empty')
|
||||
VERIFICATION_PATH=$(printf '%s\n' "$INIT" | jq -r '.verification_path // empty')
|
||||
UAT_PATH=$(printf '%s\n' "$INIT" | jq -r '.uat_path // empty')
|
||||
CONTEXT_PATH=$(printf '%s\n' "$INIT" | jq -r '.context_path // empty')
|
||||
```
|
||||
|
||||
## 8. Spawn gsd-planner Agent
|
||||
|
||||
Reference in New Issue
Block a user