-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuninstall.sh
More file actions
executable file
·94 lines (83 loc) · 2.4 KB
/
uninstall.sh
File metadata and controls
executable file
·94 lines (83 loc) · 2.4 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
#!/bin/bash
# PostForge Uninstall Script
# Removes virtual environment, system commands, and cached data
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo "=================================="
echo " PostForge Uninstall"
echo "=================================="
echo ""
# Remove system-wide launcher commands
INSTALL_DIR="/usr/local/bin"
REMOVED_CMDS=false
for cmd in pf postforge; do
if [[ -f "$INSTALL_DIR/$cmd" ]]; then
# Verify it's a PostForge launcher before removing
if grep -q "postforge" "$INSTALL_DIR/$cmd" 2>/dev/null; then
echo "Removing $INSTALL_DIR/$cmd..."
if sudo rm "$INSTALL_DIR/$cmd"; then
echo -e "${GREEN}Removed: $INSTALL_DIR/$cmd${NC}"
REMOVED_CMDS=true
else
echo -e "${YELLOW}Could not remove $INSTALL_DIR/$cmd (sudo required).${NC}"
fi
fi
fi
done
if [[ "$REMOVED_CMDS" == false ]]; then
echo "No system commands found in $INSTALL_DIR."
fi
echo ""
# Remove virtual environment
if [[ -d "venv" ]]; then
echo "Removing virtual environment..."
rm -rf venv
echo -e "${GREEN}Removed: venv/${NC}"
else
echo "No virtual environment found."
fi
echo ""
# Remove font discovery cache
CACHE_DIR="$HOME/.cache/postforge"
if [[ -d "$CACHE_DIR" ]]; then
echo "Removing font cache..."
rm -rf "$CACHE_DIR"
echo -e "${GREEN}Removed: $CACHE_DIR${NC}"
else
echo "No font cache found."
fi
echo ""
# Remove build artifacts
CLEANED=false
if [[ -d "build" ]]; then
rm -rf build
echo -e "${GREEN}Removed: build/${NC}"
CLEANED=true
fi
if [[ -d "postforge.egg-info" ]]; then
rm -rf postforge.egg-info
echo -e "${GREEN}Removed: postforge.egg-info/${NC}"
CLEANED=true
fi
for so_file in postforge/operators/_control_cy*.so postforge/devices/common/_image_conv_cy*.so; do
if [[ -f "$so_file" ]]; then
rm -f "$so_file"
echo -e "${GREEN}Removed: $so_file${NC}"
CLEANED=true
fi
done
if [[ "$CLEANED" == false ]]; then
echo "No build artifacts found."
fi
echo ""
echo -e "${GREEN}=================================="
echo -e " Uninstall Complete"
echo -e "==================================${NC}"
echo ""
echo "The PostForge source code is still in: $SCRIPT_DIR"
echo "To remove it entirely: rm -rf $SCRIPT_DIR"
echo ""