-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathuninstall.sh
More file actions
executable file
·77 lines (62 loc) · 2.26 KB
/
Copy pathuninstall.sh
File metadata and controls
executable file
·77 lines (62 loc) · 2.26 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
# Claude Code Documentation Mirror - Uninstall Script
# This script cleanly removes the Claude Code documentation mirror installation
set -euo pipefail
# Color codes for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Function to print colored output
print_color() {
local color=$1
shift
echo -e "${color}$*${NC}"
}
# Get the directory where this script is located
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
print_color "$GREEN" "Claude Code Documentation Mirror - Uninstaller"
print_color "$GREEN" "============================================"
echo
# Check if running from the installation directory
if [[ ! -f "$SCRIPT_DIR/CLAUDE.md" ]] || [[ ! -d "$SCRIPT_DIR/docs" ]]; then
print_color "$RED" "Error: This script must be run from the claude-code-docs installation directory."
exit 1
fi
print_color "$YELLOW" "This will remove the Claude Code documentation mirror from:"
print_color "$YELLOW" " $SCRIPT_DIR"
echo
# Show what will be removed
print_color "$YELLOW" "The following will be removed:"
echo " - The entire claude-code-docs directory"
echo " - Python virtual environment (.venv)"
echo " - Local git repository"
echo " - All documentation files"
echo
# Ask for confirmation
read -p "Are you sure you want to uninstall? (y/N): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
print_color "$YELLOW" "Uninstall cancelled."
exit 0
fi
# Remove the directory
print_color "$YELLOW" "Removing installation directory..."
cd ..
rm -rf "$SCRIPT_DIR"
print_color "$GREEN" "✓ Claude Code documentation mirror has been uninstalled successfully."
echo
# Check for other installations
print_color "$YELLOW" "Checking for other installations..."
OTHER_INSTALL=""
if [[ -d "$HOME/claude-code-docs" ]] && [[ "$HOME/claude-code-docs" != "$SCRIPT_DIR" ]]; then
OTHER_INSTALL="$HOME/claude-code-docs"
elif [[ -d "$HOME/Projects/claude-code-docs" ]] && [[ "$HOME/Projects/claude-code-docs" != "$SCRIPT_DIR" ]]; then
OTHER_INSTALL="$HOME/Projects/claude-code-docs"
fi
if [[ -n "$OTHER_INSTALL" ]]; then
print_color "$YELLOW" "Note: Another installation was found at: $OTHER_INSTALL"
echo "To remove it, run: rm -rf \"$OTHER_INSTALL\""
fi
echo
print_color "$GREEN" "Uninstall complete!"