mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-06 05:35:46 +02:00
fix: use find instead of ls for zsh glob safety
Codex adversarial review caught that $(ls .pending-* 2>/dev/null) still triggers zsh NOMATCH error because the shell expands the glob before ls runs. Using find avoids shell glob expansion entirely.
This commit is contained in:
@@ -212,8 +212,8 @@ echo "TELEMETRY: \${_TEL:-off}"
|
||||
echo "TEL_PROMPTED: $_TEL_PROMPTED"
|
||||
mkdir -p ~/.gstack/analytics
|
||||
echo '{"skill":"${ctx.skillName}","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true
|
||||
# zsh-compatible: check if .pending-* files exist before looping
|
||||
[ -n "$(ls ~/.gstack/analytics/.pending-* 2>/dev/null)" ] && for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ${ctx.paths.binDir}/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done
|
||||
# zsh-compatible: use find instead of glob to avoid NOMATCH error
|
||||
for _PF in $(find ~/.gstack/analytics -maxdepth 1 -name '.pending-*' 2>/dev/null); do [ -f "$_PF" ] && ${ctx.paths.binDir}/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done
|
||||
\`\`\``;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user