~cytrogen/gstack

ref: 336dbaa50d856ae9ee82d9323fd47ee57605d4ba gstack/bin/dev-teardown -rwxr-xr-x 946 bytes
336dbaa5 — Garry Tan fix: detect is_error from claude -p result line (ConnectionRefused was PASS) a month ago
                                                                                
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
#!/usr/bin/env bash
# Remove local dev skill symlinks. Restores global gstack as the active install.
set -e

REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
SKILLS_DIR="$REPO_ROOT/.claude/skills"

if [ ! -d "$SKILLS_DIR" ]; then
  echo "Nothing to tear down — .claude/skills/ doesn't exist."
  exit 0
fi

# Remove individual skill symlinks
removed=()
for link in "$SKILLS_DIR"/*/; do
  name="$(basename "$link")"
  [ "$name" = "gstack" ] && continue
  if [ -L "${link%/}" ]; then
    rm "${link%/}"
    removed+=("$name")
  fi
done

# Remove the gstack symlink
if [ -L "$SKILLS_DIR/gstack" ]; then
  rm "$SKILLS_DIR/gstack"
  removed+=("gstack")
fi

# Clean up empty dirs
rmdir "$SKILLS_DIR" 2>/dev/null || true
rmdir "$REPO_ROOT/.claude" 2>/dev/null || true

if [ ${#removed[@]} -gt 0 ]; then
  echo "Removed: ${removed[*]}"
else
  echo "No symlinks found."
fi
echo "Dev mode deactivated. Global gstack (~/.claude/skills/gstack) is now active."