-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsync.sh
More file actions
executable file
·34 lines (29 loc) · 1009 Bytes
/
Copy pathsync.sh
File metadata and controls
executable file
·34 lines (29 loc) · 1009 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
set -euo pipefail
# Sync the local Claude Code skill folder into this repo clone and push.
# Run after editing ~/.claude/skills/visualizing-data.
#
# ./sync.sh
#
# Override the skill path if needed: SKILL=/path/to/skill ./sync.sh
SKILL="${SKILL:-$HOME/.claude/skills/visualizing-data}"
REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ ! -d "$SKILL" ]; then
echo "Skill folder not found: $SKILL" >&2
exit 1
fi
# Mirror skill -> repo. --delete propagates removals/renames.
# Repo-only meta files are excluded so they are never wiped.
rsync -a --delete \
--exclude='.git' --exclude='.DS_Store' --exclude='node_modules' --exclude='__pycache__' \
--exclude='README.md' --exclude='LICENSE' --exclude='.gitignore' --exclude='sync.sh' \
"$SKILL"/ "$REPO"/
cd "$REPO"
if git diff --quiet && git diff --cached --quiet; then
echo "No changes to sync."
exit 0
fi
git add -A
git commit -m "sync skill update: $(date '+%Y-%m-%d %H:%M')"
git push
echo "Synced and pushed."