|
| 1 | +#!/bin/bash |
| 2 | +# ========================================================================== |
| 3 | +# Library Insight - Uninstaller Script |
| 4 | +# ========================================================================== |
| 5 | +# This script removes the global library-insight binary symlink, the |
| 6 | +# installation directory ($HOME/.library-insight), and all registered AI skills. |
| 7 | +# |
| 8 | +# Usage: |
| 9 | +# curl -fsSL https://raw.githubusercontent.com/Coding-Meet/Library-Insight/main/uninstall.sh | bash |
| 10 | +# or |
| 11 | +# ./uninstall.sh |
| 12 | +# ========================================================================== |
| 13 | + |
| 14 | +set -e |
| 15 | + |
| 16 | +INSTALL_DIR="$HOME/.library-insight" |
| 17 | +SYMLINK="/usr/local/bin/library-insight" |
| 18 | + |
| 19 | +echo "==================================================" |
| 20 | +echo " Uninstalling Library Insight..." |
| 21 | +echo "==================================================" |
| 22 | + |
| 23 | +# 1. Remove global symlink |
| 24 | +if [ -L "$SYMLINK" ] || [ -f "$SYMLINK" ]; then |
| 25 | + echo "Removing global symlink at $SYMLINK..." |
| 26 | + if [ -w "/usr/local/bin" ]; then |
| 27 | + rm -f "$SYMLINK" |
| 28 | + else |
| 29 | + sudo rm -f "$SYMLINK" |
| 30 | + fi |
| 31 | + echo " -> Symlink removed." |
| 32 | +fi |
| 33 | + |
| 34 | +# 2. Remove installation directory and caches |
| 35 | +if [ -d "$INSTALL_DIR" ]; then |
| 36 | + echo "Removing installation directory ($INSTALL_DIR)..." |
| 37 | + rm -rf "$INSTALL_DIR" |
| 38 | + echo " -> Installation directory removed." |
| 39 | +fi |
| 40 | + |
| 41 | +# 3. Remove global AI Agent Skill registrations |
| 42 | +echo "Removing registered global AI Agent Skills..." |
| 43 | +SKILL_PATHS=( |
| 44 | + "$HOME/.claude/skills/library-insight" |
| 45 | + "$HOME/.agents/skills/library-insight" |
| 46 | + "$HOME/.codex/skills/library-insight" |
| 47 | + "$HOME/.cursor/skills/library-insight" |
| 48 | + "$HOME/.gemini/skills/library-insight" |
| 49 | + "$HOME/.gemini/config/skills/library-insight" |
| 50 | + "$HOME/.copilot/skills/library-insight" |
| 51 | + "$HOME/.junie/skills/library-insight" |
| 52 | +) |
| 53 | + |
| 54 | +REMOVED_SKILLS=0 |
| 55 | +for path in "${SKILL_PATHS[@]}"; do |
| 56 | + if [ -d "$path" ]; then |
| 57 | + rm -rf "$path" |
| 58 | + echo " -> Removed AI Skill at: $path" |
| 59 | + REMOVED_SKILLS=$((REMOVED_SKILLS + 1)) |
| 60 | + fi |
| 61 | +done |
| 62 | + |
| 63 | +echo "" |
| 64 | +echo "==================================================" |
| 65 | +echo " SUCCESS: Library Insight has been completely uninstalled!" |
| 66 | +echo "==================================================" |
| 67 | +echo "" |
0 commit comments