-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathuninstall.sh
More file actions
69 lines (57 loc) · 1.71 KB
/
uninstall.sh
File metadata and controls
69 lines (57 loc) · 1.71 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
#!/bin/bash
log_info() {
echo "INFO - $1"
}
log_error() {
echo "ERROR - $1" >&2
exit 1
}
# Remove Aseprite from Linux
uninstall_linux() {
log_info "Uninstalling Aseprite from /opt/aseprite..."
if [ -d "/opt/aseprite" ]; then
sudo rm -rf /opt/aseprite || log_error "Failed to remove /opt/aseprite."
log_info "Removed /opt/aseprite."
else
log_info "/opt/aseprite not found."
fi
if [ -f "$HOME/.local/share/applications/aseprite.desktop" ]; then
rm "$HOME/.local/share/applications/aseprite.desktop" || log_error "Failed to remove desktop entry."
log_info "Removed desktop entry."
fi
log_info "Aseprite uninstalled from Linux."
}
# Remove Aseprite from macOS
uninstall_macos() {
log_info "Uninstalling Aseprite from /Applications..."
if [ -d "/Applications/Aseprite.app" ]; then
sudo rm -rf "/Applications/Aseprite.app" || log_error "Failed to remove /Applications/Aseprite.app."
log_info "Removed /Applications/Aseprite.app."
else
log_info "/Applications/Aseprite.app not found."
fi
log_info "Aseprite uninstalled from macOS."
}
# Remove build dependencies and temp files
cleanup() {
log_info "Removing build directories..."
rm -rf "$HOME/deps" /tmp/aseprite /tmp/bundle
log_info "Removed build directories."
}
# Main execution block
if [ "$(id -u)" -eq 0 ]; then
log_error "Do not run this script as root. It will prompt for sudo when needed."
fi
case "$(uname -s)" in
Linux*)
uninstall_linux
;;
Darwin*)
uninstall_macos
;;
*)
log_error "Unsupported OS. Only Linux and macOS are supported."
;;
esac
cleanup
log_info "Uninstallation complete."