Skip to content

fix: guard empty context array in spec command under set -u#48

Merged
satyaborg merged 1 commit into
mainfrom
fix/spec-empty-context-unbound
Jun 9, 2026
Merged

fix: guard empty context array in spec command under set -u#48
satyaborg merged 1 commit into
mainfrom
fix/spec-empty-context-unbound

Conversation

@satyaborg

Copy link
Copy Markdown
Owner

Summary

  • devloop spec with no source material crashed with context_items[@]: unbound variable on macOS bash 3.2, because set -uo pipefail rejects expanding an empty array via "${context_items[@]}".
  • Switched the call site to the bash 3.2-safe guard ${context_items[@]+"${context_items[@]}"}, so an empty array expands to nothing and resolve_spec_context correctly takes its cold-start (zero-args) path.

Test plan

  • bash scripts/devloop_test.sh — all pass (incl. 100% function coverage)
  • bash -n devloop syntax check
  • Reproduced the empty-array-under-set -u failure and confirmed the new pattern clears it

@satyaborg satyaborg merged commit f1f2b7c into main Jun 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant