Skip to content

Commit 9bf195f

Browse files
committed
fix(qa-gather): deterministic script discovery without head pipeline
Replace the find|head -n1 alternation with one find per script name, preferring jira-qa-gather.py over the legacy qa-gather.py regardless of filesystem order, and use -type f -print -quit so find stops at the first match - no pipeline, hence no SIGPIPE/141 risk under pipefail. Signed-off-by: Sebastian Mendel <github@sebastianmendel.de>
1 parent 55d1d82 commit 9bf195f

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

skills/peer-qa-review/scripts/qa-gather.sh

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,22 @@ find_qa_gather() {
3131
"${HOME}/.claude/plugins/cache/netresearch-claude-code-marketplace/jira-integration"
3232
"${HOME}/.claude/plugins/cache"
3333
)
34-
local p
34+
# Prefer the current script name (jira-integration >= 3.13) over the
35+
# legacy one, deterministically: one find per name, first match wins.
36+
# `-print -quit` stops at the first hit — no `| head` pipeline, so no
37+
# SIGPIPE risk under `set -o pipefail`.
38+
local p name found
3539
for p in "${search_paths[@]}"; do
3640
[[ -z "$p" ]] && continue
37-
local found
38-
found=$(find "$p" -maxdepth 6 \( -path '*/skills/jira-communication/scripts/utility/jira-qa-gather.py' -o -path '*/skills/jira-communication/scripts/utility/qa-gather.py' \) 2>/dev/null | head -n1)
39-
if [[ -n "$found" ]]; then
40-
echo "$found"
41-
return 0
42-
fi
41+
for name in jira-qa-gather.py qa-gather.py; do
42+
found=$(find "$p" -maxdepth 6 -type f \
43+
-path "*/skills/jira-communication/scripts/utility/${name}" \
44+
-print -quit 2>/dev/null) || true
45+
if [[ -n "$found" ]]; then
46+
echo "$found"
47+
return 0
48+
fi
49+
done
4350
done
4451
return 1
4552
}

0 commit comments

Comments
 (0)