diff --git a/install.sh b/install.sh index 5cef82b..c3e3852 100755 --- a/install.sh +++ b/install.sh @@ -160,9 +160,12 @@ cleanup # ══════════════════════════════════════════════════════ # Summary # ══════════════════════════════════════════════════════ -AGENT_COUNT=$(ls .claude/agents/*.md 2>/dev/null | wc -l | tr -d ' ') -SKILL_COUNT=$(ls -d .claude/skills/*/ 2>/dev/null | wc -l | tr -d ' ') -HOOK_COUNT=$(ls .claude/hooks/*.cjs 2>/dev/null | wc -l | tr -d ' ') +# grep | wc -l: with `set -o pipefail`, a zero-match grep exits 1 and would +# abort the installer. Tolerate zero matches by appending `|| true` to the +# grep stage only — `wc -l` still returns 0 when no lines match. +AGENT_COUNT=$( (echo "$FILES" | grep -E '^\.(claude|codex)/agents/' || true) | wc -l | tr -d ' ') +SKILL_COUNT=$( (echo "$FILES" | grep -E '/SKILL\.md$' || true) | wc -l | tr -d ' ') +HOOK_COUNT=$( (echo "$FILES" | grep -E '/hooks/[^/]+\.cjs$' || true) | wc -l | tr -d ' ') echo "" echo -e " ${GREEN}Install complete.${NC} (v$VERSION)"