Skip to content

Commit 4fa160d

Browse files
tommysituclaude
andcommitted
fix(release-skill): make Phase 3 asset count shell-agnostic
The naive `for e in $expected; do grep -qx "$e"; done` count silently reports 0/7 under zsh, which does not word-split unquoted variables. Replace it with a POSIX-portable command (printf list piped to `grep -Fxf -` against a temp file) that works in sh, bash, and zsh, and document why each portable choice was made. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 0128113 commit 4fa160d

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

.claude/skills/release/SKILL.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,30 @@ Poll once per minute until **all 7** expected zip bundles appear in the release
4848
- `hoverfly_bundle_linux_386.zip`
4949
- `hoverfly_bundle_linux_arm64.zip`
5050

51-
To check, run:
51+
To check, run this (counts how many of the 7 expected bundles are present).
52+
It is shell-agnostic — works in sh, bash, and zsh:
5253
```
53-
gh release view $ARGUMENTS --json assets --jq '.assets[].name'
54+
gh release view $ARGUMENTS --json assets --jq '.assets[].name' > /tmp/hf_release_assets.txt
55+
printf '%s\n' \
56+
hoverfly_bundle_OSX_amd64.zip \
57+
hoverfly_bundle_OSX_arm64.zip \
58+
hoverfly_bundle_windows_amd64.zip \
59+
hoverfly_bundle_windows_386.zip \
60+
hoverfly_bundle_linux_amd64.zip \
61+
hoverfly_bundle_linux_386.zip \
62+
hoverfly_bundle_linux_arm64.zip \
63+
| grep -Fxf - /tmp/hf_release_assets.txt | wc -l | xargs
5464
```
5565

66+
> NOTE: Keep the count shell-agnostic. The command above relies only on POSIX
67+
> features (`printf`, a pipe, `grep -Fxf -` reading patterns from stdin, a temp
68+
> file) — no process substitution `<(...)`, no arrays, no unquoted word-splitting.
69+
> Do NOT count with `for e in $expected; do grep -qx "$e"; done`: in zsh,
70+
> unquoted `$expected` is NOT word-split, so the loop runs once over the whole
71+
> string and always reports `0/7`.
72+
5673
Each poll iteration:
57-
- Count how many of the 7 expected files are present
74+
- Run the command above to get the count (0–7)
5875
- Report progress to the user: "X/7 assets uploaded..."
5976
- Sleep 60 seconds between checks
6077
- After 45 minutes with no completion, warn the user and ask whether to keep waiting

0 commit comments

Comments
 (0)