-
Notifications
You must be signed in to change notification settings - Fork 190
Expand file tree
/
Copy pathuninstall.sh
More file actions
executable file
·49 lines (40 loc) · 1.27 KB
/
uninstall.sh
File metadata and controls
executable file
·49 lines (40 loc) · 1.27 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
#!/bin/sh
# container-use uninstaller script
set -euo pipefail
main() {
local BINARY_NAME="container-use"
local INSTALL_DIR="${BIN_DIR:-$HOME/.local/bin}"
local BINARY_PATH="$INSTALL_DIR/$BINARY_NAME"
if [ ! -f "$BINARY_PATH" ]; then
echo "container-use not found at $BINARY_PATH"
exit 1
fi
# Safety check: don't delete from system paths or homebrew
case "$BINARY_PATH" in
/usr/bin/* | /bin/* | /usr/local/bin/* | /opt/homebrew/bin/*)
echo "Error: Refusing to delete from system/brew path: $BINARY_PATH"
echo "This script only removes container-use from user directories"
exit 1
;;
esac
echo "Found container-use at: $BINARY_PATH"
printf "Remove this file? (y/N): "
read -r response
case "$response" in
[yY]|[yY][eE][sS])
rm -f "$BINARY_PATH"
echo "Removed $BINARY_PATH"
# Also remove cu symlink if it exists
local SYMLINK_PATH="$INSTALL_DIR/cu"
if [ -L "$SYMLINK_PATH" ]; then
rm -f "$SYMLINK_PATH"
echo "Removed cu symlink at $SYMLINK_PATH"
fi
;;
*)
echo "Cancelled"
exit 1
;;
esac
}
main "$@"