-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathuninstall.sh
More file actions
executable file
·32 lines (29 loc) · 1.06 KB
/
Copy pathuninstall.sh
File metadata and controls
executable file
·32 lines (29 loc) · 1.06 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
#!/usr/bin/env bash
set -euo pipefail
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
OPENCLAW_DIR="${OPENCLAW_HOME:-$HOME/.openclaw}"
INSTALL_TARGET="$OPENCLAW_DIR/extensions/superpowers"
STATE_DIR="$OPENCLAW_DIR/skill-state"
# --- Deregister cron jobs BEFORE removing the symlink ---
CRON_COUNT=0
for skill_file in "$REPO_DIR/skills/openclaw-native"/*/SKILL.md; do
[ -f "$skill_file" ] || continue
skill_name="$(basename "$(dirname "$skill_file")")"
fm_cron="$(sed -n '2,/^---$/p' "$skill_file" | grep '^cron:' | sed 's/^cron: *//' | tr -d '"'"'")"
if [ -n "$fm_cron" ]; then
openclaw cron remove "$skill_name" 2>/dev/null || true
echo " - cron removed: $skill_name"
CRON_COUNT=$((CRON_COUNT + 1))
fi
done
# --- Remove symlink ---
if [ -L "$INSTALL_TARGET" ] || [ -d "$INSTALL_TARGET" ]; then
rm -rf "$INSTALL_TARGET"
echo "openclaw-superpowers removed."
else
echo "Nothing to uninstall."
fi
echo ""
echo " Cron jobs deregistered: $CRON_COUNT"
echo " Runtime state preserved at: $STATE_DIR"
echo " (Remove manually if no longer needed)"