-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.sh
More file actions
executable file
·61 lines (54 loc) · 1.68 KB
/
Copy pathuninstall.sh
File metadata and controls
executable file
·61 lines (54 loc) · 1.68 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
61
#!/usr/bin/env zsh
# claude-nightshift uninstaller — clean removal
set -euo pipefail
NIGHTSHIFT_DIR="$HOME/.claude/nightshift"
SETTINGS="$HOME/.claude/settings.json"
echo
echo "claude-nightshift uninstaller"
echo "------------------------------"
# Unload and remove any active launchd jobs
for plist in "$HOME/Library/LaunchAgents/com.claude.nightshift."*.plist; do
[[ -f "$plist" ]] || continue
launchctl unload "$plist" 2>/dev/null || true
rm -f "$plist"
printf " removed %s\n" "$(basename "$plist")"
done
# Remove scripts and job state
if [[ -d "$NIGHTSHIFT_DIR" ]]; then
rm -rf "$NIGHTSHIFT_DIR"
echo " removed $NIGHTSHIFT_DIR"
fi
# Remove PATH symlink
if [[ -L "$HOME/.local/bin/claude-schedule-resume" ]]; then
rm -f "$HOME/.local/bin/claude-schedule-resume"
echo " removed ~/.local/bin/claude-schedule-resume"
fi
# Remove hook entry from settings.json
if [[ -f "$SETTINGS" ]]; then
export SETTINGS
python3 - <<'PY'
import json, os
settings_path = os.environ["SETTINGS"]
with open(settings_path) as f:
s = json.load(f)
hooks = s.get("hooks", {})
before = len(hooks.get("StopFailure", []))
hooks["StopFailure"] = [
e for e in hooks.get("StopFailure", [])
if not any("nightshift" in str(h.get("command",""))
for h in e.get("hooks", []))
]
if not hooks.get("StopFailure"):
hooks.pop("StopFailure", None)
if not hooks:
s.pop("hooks", None)
with open(settings_path + ".tmp", "w") as f:
json.dump(s, f, indent=2)
os.rename(settings_path + ".tmp", settings_path)
after = len(s.get("hooks",{}).get("StopFailure",[]))
print(f" removed {before - after} hook entry from settings.json")
PY
fi
echo
echo "Done. claude-nightshift removed."
echo