-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbrainstack-uninstall
More file actions
executable file
·47 lines (40 loc) · 1.34 KB
/
Copy pathbrainstack-uninstall
File metadata and controls
executable file
·47 lines (40 loc) · 1.34 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
#!/usr/bin/env bash
# brainstack-uninstall - remove brainstack cleanly. Your vault is never touched.
#
# Removes:
# - the skills from $HERMES_HOME/skills/brainstack/
# - the engine at ~/.brainstack/ (bin, env.sh, venv, logs)
# - the `brain` launcher from ~/.local/bin
# - the dream-cycle cron line
#
# Usage: brainstack-uninstall [--yes]
set -euo pipefail
HERMES_HOME="${HERMES_HOME:-$HOME/.hermes}"
BRAINSTACK_HOME="${BRAINSTACK_HOME:-$HOME/.brainstack}"
if [ "${1:-}" != "--yes" ]; then
echo "This removes brainstack (skills, engine, cron). Your vault is NOT touched."
printf "Continue? [y/N] "
read -r ans
case "$ans" in y|Y|yes) ;; *) echo "aborted."; exit 1 ;; esac
fi
# 1. cron
if command -v crontab >/dev/null 2>&1 && crontab -l 2>/dev/null | grep -q "dream-cycle.py"; then
crontab -l 2>/dev/null | grep -v "dream-cycle.py" | crontab -
echo "removed: dream-cycle cron"
fi
# 2. skills
if [ -d "$HERMES_HOME/skills/brainstack" ]; then
rm -rf "$HERMES_HOME/skills/brainstack"
echo "removed: $HERMES_HOME/skills/brainstack"
fi
# 3. launcher
if [ -e "$HOME/.local/bin/brain" ]; then
rm -f "$HOME/.local/bin/brain"
echo "removed: ~/.local/bin/brain"
fi
# 4. engine
if [ -d "$BRAINSTACK_HOME" ]; then
rm -rf "$BRAINSTACK_HOME"
echo "removed: $BRAINSTACK_HOME"
fi
echo "brainstack uninstalled. Your vault and its git history are intact."