gstack/scripts
Hiten Shah cfda9cb46f
fix(preamble): make .pending-* glob pattern zsh-compatible (fixes #313)
**Problem:**
When running gstack skills in zsh, users see this error:
  (eval):22: no matches found: /Users/.../.gstack/analytics/.pending-*

**Root Cause:**
The Preamble code in gen-skill-docs.ts (line 167) contains:
  for _PF in ~/.gstack/analytics/.pending-*; do ...

In zsh, glob patterns that don't match any files cause an error:
  'no matches found: pattern'

In bash, the loop simply iterates zero times. This breaks all gstack
skills for zsh users (common on macOS).

**Solution:**
Check if any .pending-* files exist BEFORE attempting the for loop:
  [ -n "$(ls ~/.gstack/analytics/.pending-* 2>/dev/null)" ] && for ...

This approach:
-  Works in both bash and zsh
-  Silently skips the loop when no pending files exist (normal case)
-  Executes the loop when pending files are present
-  Uses ls with error suppression (2>/dev/null) for portability

**Testing:**
-  No pending files: loop skipped, no error
-  Pending files exist: loop runs normally
-  Compatible with bash and zsh
-  TypeScript syntax check passes

**Impact:**
Fixes all gstack skills for zsh users (macOS default shell).

Fixes #313
2026-03-23 06:46:37 -07:00
..
analytics.ts feat: safety hook skills + skill usage telemetry (v0.7.1) (#189) 2026-03-18 23:57:59 -05:00
dev-skill.ts feat: SKILL.md template system, 3-tier testing, DX tools (v0.3.3) (#41) 2026-03-13 21:08:12 -07:00
eval-compare.ts feat: eval CLI tools + docs cleanup 2026-03-14 03:49:57 -05:00
eval-list.ts feat: QA restructure, browser ref staleness, eval efficiency metrics (v0.4.0) (#83) 2026-03-15 23:55:39 -05:00
eval-select.ts feat: diff-based test selection for E2E and LLM-judge evals (v0.6.1.0) (#139) 2026-03-17 18:45:41 -05:00
eval-summary.ts feat: QA restructure, browser ref staleness, eval efficiency metrics (v0.4.0) (#83) 2026-03-15 23:55:39 -05:00
eval-watch.ts fix: auto-clear stale heartbeat when process is dead 2026-03-14 12:55:40 -05:00
gen-skill-docs.ts fix(preamble): make .pending-* glob pattern zsh-compatible (fixes #313) 2026-03-23 06:46:37 -07:00
skill-check.ts feat: multi-agent support — gstack works on Codex, Gemini CLI, and Cursor (v0.9.0) (#226) 2026-03-19 18:20:50 -07:00