Skip to content

zsh glob error: 'no matches found' for .pending-* pattern #313

Closed

Description

@stillfox-lee

Problem

When running gstack skills in zsh, getting this error:

(eval):22: no matches found: /Users/liaosiyi/.gstack/analytics/.pending-*

Root Cause

The Preamble code in every skill contains:
``bash
for _PF in ~/.gstack/analytics/.pending-*; do ...


When no `.pending-*` files exist (which is the common case), zsh errors with "no matches found" because it doesn't handle unmatched glob patterns like bash does.

## Environment
- Shell: zsh
- gstack version: latest (installed from source)
- macOS (likely affects all platforms with zsh)

## Suggested Fix

In `scripts/gen-skill-docs.ts` line 165, change:
``typescript
for _PF in ~/.gstack/analytics/.pending-*; do ...

To:
``typescript
// zsh compatibility: nullglob for missing .pending-* files
(for _PF in ~/.gstack/analytics/.pending-* 2>/dev/null; do ...) 2>/dev/null || true


This wraps the for loop in a subshell with error suppression, making it compatible with both bash and zsh.

Activity

  1. added 2 commits that reference this issue on Mar 22, 2026
    d3300d4
    734d30a
  2. added a commit that references this issue on Mar 23, 2026
    cfda9cb
  3. added 2 commits that reference this issue on Mar 23, 2026
    8a4afd8
    d8c445b
  4. added a commit that references this issue on Mar 29, 2026
    a50cb94
  5. added a commit that references this issue on Mar 29, 2026
    0b5352f
  6. added a commit that references this issue on May 30, 2026
    991bd6e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions