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) <noreply@anthropic.com>
This commit is contained in:
parent
4d3fb6a661
commit
94b79d2ebb
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user