-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall
More file actions
executable file
·121 lines (98 loc) · 3.92 KB
/
uninstall
File metadata and controls
executable file
·121 lines (98 loc) · 3.92 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/usr/bin/env zsh
BASE_DIR=$( cd $( dirname ${(%):-%x} ) &> /dev/null && pwd )
source ${BASE_DIR}/lib/colors
failure_log=/tmp/uninstall_failures_$$
manual_log=/tmp/uninstall_manual_$$
echo -e "${BOLD}${YELLOW}Starting macOS uninstall...${NC}"
echo ""
# Phase 1: AI tool configs (skipped by default - these are personal configs)
if [[ "${UNINSTALL_AI_CONFIGS:-false}" == "true" ]]; then
echo -e "${YELLOW}Phase 1:${NC} AI tool configs"
${BASE_DIR}/gemini/uninstall
${BASE_DIR}/cursor/uninstall
${BASE_DIR}/codex/uninstall
${BASE_DIR}/claude/uninstall
${BASE_DIR}/antigravity/uninstall
else
echo -e "${YELLOW}Phase 1:${NC} AI tool configs ${CYAN}(skipped - set UNINSTALL_AI_CONFIGS=true to include)${NC}"
fi
# Phase 2: Custom configs
echo -e "\n${YELLOW}Phase 2:${NC} Custom configs"
${BASE_DIR}/vim/uninstall
${BASE_DIR}/git/uninstall
# Phase 3: VS Code extensions
echo -e "\n${YELLOW}Phase 3:${NC} VS Code extensions"
${BASE_DIR}/lib/uninstall-tools vscode $failure_log $manual_log
# Phase 4: Cursor extensions
echo -e "\n${YELLOW}Phase 4:${NC} Cursor extensions"
${BASE_DIR}/lib/uninstall-tools cursor $failure_log $manual_log
# Phase 5: Mac App Store apps
echo -e "\n${YELLOW}Phase 5:${NC} Mac App Store apps"
${BASE_DIR}/lib/uninstall-tools mas $failure_log $manual_log
# Phase 6: Python tools (via uv)
echo -e "\n${YELLOW}Phase 6:${NC} Python tools"
${BASE_DIR}/lib/uninstall-tools uv $failure_log $manual_log
# Phase 7: Google Cloud components (before removing gcloud-cli cask)
echo -e "\n${YELLOW}Phase 7:${NC} Google Cloud components"
${BASE_DIR}/lib/uninstall-tools gcloud $failure_log $manual_log
# Phase 8: NPM packages (before removing node)
echo -e "\n${YELLOW}Phase 8:${NC} NPM packages"
${BASE_DIR}/lib/uninstall-tools npm $failure_log $manual_log
# Phase 9: Go tools (before removing Go via mise)
echo -e "\n${YELLOW}Phase 9:${NC} Go tools"
${BASE_DIR}/lib/uninstall-tools go $failure_log $manual_log
# Phase 10: Brew casks
echo -e "\n${YELLOW}Phase 10:${NC} Brew casks"
${BASE_DIR}/lib/uninstall-tools brew-cask $failure_log $manual_log
# Phase 11: Mise-managed tools
echo -e "\n${YELLOW}Phase 11:${NC} Mise-managed tools"
${BASE_DIR}/lib/uninstall-tools mise $failure_log $manual_log
# Phase 12: Mise version manager
echo -e "\n${YELLOW}Phase 12:${NC} Mise version manager"
${BASE_DIR}/mise/uninstall
# Phase 13: Shell configs
echo -e "\n${YELLOW}Phase 13:${NC} Shell configs"
${BASE_DIR}/bash/uninstall
${BASE_DIR}/zsh/uninstall
# Phase 14: Brew packages (reverse order)
echo -e "\n${YELLOW}Phase 14:${NC} Brew packages"
${BASE_DIR}/lib/uninstall-tools brew --reverse $failure_log $manual_log
# Phase 15: Homebrew
echo -e "\n${YELLOW}Phase 15:${NC} Homebrew"
${BASE_DIR}/brew/uninstall
# Final summary
has_failures=false
has_manual=false
[[ -f $failure_log ]] && has_failures=true
[[ -f $manual_log ]] && has_manual=true
echo ""
echo -e "${GREEN}========================================${NC}"
echo -e "${GREEN}${BOLD}Uninstall Complete${NC}"
echo -e "${GREEN}========================================${NC}"
if [[ "$has_failures" == "true" || "$has_manual" == "true" ]]; then
echo ""
echo -e "${YELLOW}========================================${NC}"
echo -e "${YELLOW}${BOLD}Summary${NC}"
echo -e "${YELLOW}========================================${NC}"
if [[ "$has_failures" == "true" ]]; then
echo ""
echo -e "${BOLD}Failed:${NC}"
cat $failure_log
rm $failure_log
fi
if [[ "$has_manual" == "true" ]]; then
echo ""
echo -e "${YELLOW}${BOLD}Manual Installs (require manual removal):${NC}"
cat $manual_log
rm $manual_log
fi
echo ""
if [[ "$has_failures" == "true" ]]; then
echo -e "${RED}✗${NC} ${BOLD}Some tools failed to uninstall${NC}"
else
echo -e "${GREEN}✓${NC} ${BOLD}All managed tools removed successfully${NC}"
fi
else
echo ""
echo -e "${GREEN}✓${NC} ${BOLD}All tools removed successfully${NC}"
fi