-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.sh
More file actions
executable file
·105 lines (87 loc) · 1.97 KB
/
uninstall.sh
File metadata and controls
executable file
·105 lines (87 loc) · 1.97 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
#!/bin/bash
set -euo pipefail
# TaskForceAI CLI Uninstaller
BINARY_NAME="taskforceai"
DEFAULT_INSTALL_DIR="$HOME/.local/bin"
CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/taskforceai"
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
info() {
echo -e "${BLUE}==>${NC} $1"
}
success() {
echo -e "${GREEN}==>${NC} $1"
}
warn() {
echo -e "${YELLOW}==>${NC} $1"
}
error() {
echo -e "${RED}Error:${NC} $1" >&2
}
# Find where the binary is installed
find_binary() {
local locations=(
"$DEFAULT_INSTALL_DIR/$BINARY_NAME"
"/usr/local/bin/$BINARY_NAME"
"/usr/bin/$BINARY_NAME"
)
for loc in "${locations[@]}"; do
if [ -f "$loc" ]; then
echo "$loc"
return 0
fi
done
# Try which as fallback
if command -v "$BINARY_NAME" &>/dev/null; then
which "$BINARY_NAME"
return 0
fi
return 1
}
main() {
local binary_path
local remove_config=false
# Parse arguments
while [[ $# -gt 0 ]]; do
case $1 in
--purge)
remove_config=true
shift
;;
*)
error "Unknown option: $1"
echo "Usage: uninstall.sh [--purge]"
echo " --purge Also remove configuration and data files"
exit 1
;;
esac
done
info "Looking for TaskForceAI CLI installation..."
if binary_path=$(find_binary); then
info "Found binary at: $binary_path"
rm -f "$binary_path"
success "Removed $binary_path"
else
warn "TaskForceAI CLI binary not found"
fi
if [ "$remove_config" = true ]; then
if [ -d "$CONFIG_DIR" ]; then
info "Removing configuration directory: $CONFIG_DIR"
rm -rf "$CONFIG_DIR"
success "Removed $CONFIG_DIR"
else
info "No configuration directory found at $CONFIG_DIR"
fi
else
if [ -d "$CONFIG_DIR" ]; then
info "Configuration directory preserved at $CONFIG_DIR"
echo " Run with --purge to remove it"
fi
fi
success "TaskForceAI CLI uninstalled"
}
main "$@"