-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.sh
More file actions
executable file
·49 lines (39 loc) · 1.24 KB
/
uninstall.sh
File metadata and controls
executable file
·49 lines (39 loc) · 1.24 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
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SKILLS_DIR="$HOME/.claude/skills"
command -v realpath >/dev/null 2>&1 || { echo "Error: realpath not found. Install coreutils."; exit 1; }
resolve_path() { realpath "$1"; }
echo "Uninstalling Adversarial Dev Workflow skills..."
# Remove legacy /adw skill if present
LEGACY_TARGET="$SKILLS_DIR/adw"
if [ -L "$LEGACY_TARGET" ]; then
rm "$LEGACY_TARGET"
echo "Removed legacy skill: $LEGACY_TARGET"
fi
uninstall_skill() {
local NAME="$1"
local SOURCE="$SCRIPT_DIR/skills/$NAME"
local TARGET="$SKILLS_DIR/$NAME"
if [ ! -L "$TARGET" ]; then
if [ -e "$TARGET" ]; then
echo "Warning: $TARGET exists but is not a symlink. Skipping (not ours)."
else
echo "Nothing to uninstall: $NAME (not found)"
fi
return
fi
# Verify the symlink points to our source
EXISTING="$(resolve_path "$(readlink "$TARGET")")"
SOURCE_RESOLVED="$(resolve_path "$SOURCE")"
if [ "$EXISTING" != "$SOURCE_RESOLVED" ]; then
echo "Warning: $TARGET points to $EXISTING, not to this repo. Skipping."
return
fi
rm "$TARGET"
echo "Removed: $TARGET"
}
uninstall_skill "adw-plan"
uninstall_skill "adw-changes"
echo ""
echo "Skills uninstalled."