-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.sh
More file actions
executable file
·60 lines (51 loc) · 1.73 KB
/
uninstall.sh
File metadata and controls
executable file
·60 lines (51 loc) · 1.73 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
57
58
59
60
#!/usr/bin/env bash
#
# CodeView uninstaller — removes skill symlinks and optionally the
# /usr/local/bin/codeview launcher link.
#
set -e
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [[ -t 1 ]]; then
B=$'\033[1m'; DIM=$'\033[2m'; G=$'\033[32m'; Y=$'\033[33m'; R=$'\033[31m'; C=$'\033[36m'; N=$'\033[0m'
else
B=""; DIM=""; G=""; Y=""; R=""; C=""; N=""
fi
log() { echo -e " $*"; }
ok() { echo -e " ${G}✓${N} $*"; }
warn() { echo -e " ${Y}!${N} $*"; }
step() { echo; echo -e "${B}$*${N}"; }
SKILL_SRC="$REPO_DIR/skill/codeview"
LAUNCHER_SRC="$REPO_DIR/bin/codeview"
step "CodeView uninstaller"
# Find all Claude Code dirs where the skill might be installed
for cdir in "$HOME/.claude"; do
target="$cdir/skills/codeview"
if [[ -L "$target" ]]; then
current="$(readlink "$target")"
if [[ "$current" == "$SKILL_SRC" ]]; then
rm "$target"
ok "Removed skill symlink ${C}$target${N}"
else
warn "${C}$target${N} points to ${DIM}$current${N} (not this repo) — leaving alone"
fi
fi
done
# Remove /usr/local/bin launcher symlink if it points at us
bin_link="/usr/local/bin/codeview"
if [[ -L "$bin_link" ]]; then
if [[ "$(readlink "$bin_link")" == "$LAUNCHER_SRC" ]]; then
log ""
read -r -p " Remove /usr/local/bin/codeview symlink (needs sudo)? [y/N] " ans
if [[ "$ans" =~ ^[Yy]$ ]]; then
sudo rm "$bin_link" && ok "Removed ${C}$bin_link${N}"
fi
else
warn "${C}$bin_link${N} points elsewhere — leaving alone"
fi
fi
log ""
log "Also remove these manually if you want a clean slate:"
log " ${C}~/.codeview/${N} — running instances + recent-projects state"
log " shell alias — edit ~/.zshrc / ~/.bashrc if you added one"
log ""
ok "Done"