Fix race condition in Claude Code skill installation

This commit is contained in:
2026-01-10 12:24:06 -08:00
parent e4a1771f48
commit 38395c238f

View File

@@ -85,12 +85,17 @@ in
fi
done
# Copy local skills from this repo
# Copy local skills from this repo (with retry for race conditions with running Claude)
for file in ${./skills}/*.md; do
if [ -f "$file" ]; then
filename=$(basename "$file" .md)
dest="$HOME/.claude/commands/''${filename}.md"
cp "$file" "$dest"
# Remove existing file first, then copy with retry on failure
rm -f "$dest" 2>/dev/null || true
if ! cp "$file" "$dest" 2>/dev/null; then
sleep 0.5
cp "$file" "$dest" || echo "Warning: Failed to copy $filename.md to commands"
fi
fi
done