-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.sh
More file actions
executable file
·56 lines (44 loc) · 1.38 KB
/
uninstall.sh
File metadata and controls
executable file
·56 lines (44 loc) · 1.38 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# Remove symlinks from ~/.claude/ that point to this repo
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
SKILLS_DIR="$HOME/.claude/skills"
COMMANDS_DIR="$HOME/.claude/commands"
# Remove skill symlinks
for skill_dir in "$SCRIPT_DIR"/*/; do
skill_name="$(basename "$skill_dir")"
[[ "$skill_name" == .* ]] && continue
[[ "$skill_name" == "commands" ]] && continue
[ ! -f "$skill_dir/SKILL.md" ] && continue
target="$SKILLS_DIR/$skill_name"
if [ -L "$target" ]; then
rm "$target"
echo "Removed skill: $target"
fi
done
# Remove command symlinks
if [ -d "$SCRIPT_DIR/commands" ]; then
for cmd_file in "$SCRIPT_DIR"/commands/*.md; do
[ ! -f "$cmd_file" ] && continue
cmd_name="$(basename "$cmd_file")"
target="$COMMANDS_DIR/$cmd_name"
if [ -L "$target" ]; then
rm "$target"
echo "Removed command: $target"
fi
done
fi
# Remove third-party skill symlinks
JSON_FILE="$SCRIPT_DIR/thirdparty-skills.json"
if [ -f "$JSON_FILE" ]; then
count=$(python3 -c "import json; data=json.load(open('$JSON_FILE')); print(len(data))")
for i in $(seq 0 $((count - 1))); do
name=$(python3 -c "import json; data=json.load(open('$JSON_FILE')); print(data[$i]['name'])")
target="$SKILLS_DIR/$name"
if [ -L "$target" ]; then
rm "$target"
echo "Removed third-party skill: $target"
fi
done
fi
echo ""
echo "Done! Symlinks removed."