From 03e6aefe48b348d4475532d5a1447f3a0a2d4667 Mon Sep 17 00:00:00 2001 From: cheshirecode Date: Mon, 10 Aug 2026 22:50:04 -0400 Subject: [PATCH] fix(worklog): propagate rg errors in search.sh instead of silently swallowing The rg/xargs pipeline used 2>/dev/null || true, making rg errors (invalid regex, binary match failures) indistinguishable from genuine 'no hits' results. Capture stderr to a temp file and print it if non-empty. --- skills/worklog/bin/search.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/skills/worklog/bin/search.sh b/skills/worklog/bin/search.sh index b703951..6fa67ae 100755 --- a/skills/worklog/bin/search.sh +++ b/skills/worklog/bin/search.sh @@ -203,8 +203,13 @@ else # ripgrep's default regex syntax includes common ERE operators such as `|`. SEARCH_CMD=(grep -EnH) fi +RG_ERR=$(mktemp) || true RG_OUT=$(printf '%s\n' "$CANDIDATE_FILES" | \ - xargs "${SEARCH_CMD[@]}" -e "$PATTERN" 2>/dev/null || true) + xargs "${SEARCH_CMD[@]}" -e "$PATTERN" 2>"$RG_ERR" || true) +if [[ -s "$RG_ERR" ]]; then + cat "$RG_ERR" >&2 +fi +rm -f "$RG_ERR" if [ -z "$RG_OUT" ]; then echo "(no hits for /$PATTERN/)" >&2