From 94b79d2ebb4498ace418ec131a8acc5c4853f006 Mon Sep 17 00:00:00 2001 From: bastien Date: Sun, 3 May 2026 23:00:11 +0200 Subject: [PATCH] fix(doctor): guard gstack find against set -euo pipefail doctor.sh exited at the gstack-skills-count step on machines where ~/.claude/skills/gstack does not contain a skills/ subdirectory (e.g. when the gstack submodule layout puts skills directly at root). Under set -o pipefail, find's non-zero exit propagated through wc | tr, killing the script before it reached the prerequisites/plugins/budget sections. Wrap the find in a brace group with `|| true` so the pipe stays zero-exit and downstream sections run. Co-Authored-By: Claude Opus 4.7 (1M context) --- doctor.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doctor.sh b/doctor.sh index b408ee8..2aa55b8 100644 --- a/doctor.sh +++ b/doctor.sh @@ -87,8 +87,10 @@ if [ -L "$HOME/.claude/skills/gstack" ]; then real=$(readlink -f "$HOME/.claude/skills/gstack" 2>/dev/null || readlink "$HOME/.claude/skills/gstack") if [ -d "$real" ]; then pass "Symlink OK → $real" - # Check for skills/ subdirectory (referenced by plugin-advisor PHASE 1) - gstack_skills_count=$(find "$HOME/.claude/skills/gstack/skills/" -maxdepth 1 -mindepth 1 2>/dev/null | wc -l | tr -d ' ') + # Check for skills/ subdirectory (referenced by plugin-advisor PHASE 1). + # `|| echo 0` is required because under `set -o pipefail`, a missing + # gstack/skills/ dir makes find exit non-zero, killing the script. + gstack_skills_count=$( { find "$HOME/.claude/skills/gstack/skills/" -maxdepth 1 -mindepth 1 2>/dev/null || true; } | wc -l | tr -d ' ') if [ "${gstack_skills_count:-0}" -gt 0 ]; then pass "GStack: ${gstack_skills_count} skills available" else