-
Notifications
You must be signed in to change notification settings - Fork 34
/
uninstall.sh
executable file
·53 lines (46 loc) · 1.31 KB
/
uninstall.sh
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
#!/bin/sh
ORIGINAL_DIR=$(pwd)
confirm() {
# call with a prompt string or use a default
read -r -p "${1:-Are you sure? [y/N]} " response
case "$response" in
[yY][eE][sS]|[yY])
true
;;
*)
false
;;
esac
}
uninstall() {
sudo make uninstall && echo "Uninstalled successfully!"
}
# Recreate install manifest and uninstall
install_and_uninstall() {
sh install.sh &&
cd build &&
uninstall
echo It is possible that some files left over at the following locations
echo Please remove any files containing sierrabreezeenhanced in their name
echo - /usr/lib/qt/plugins/org.kde.kdecoration2/
echo - /usr/share/kservices5/
echo - /usr/lib/
}
if [ ! -d "build" ]; then
# If no build folder is found
confirm "No installation found, (re)install and uninstall? [y/n]" && install_and_uninstall
else
if test -f "$ORIGINAL_DIR/build/install_manifest.txt"; then
# Remove normally
echo Found $ORIGINAL_DIR/build/install_manifest.txt
cd build &&
uninstall
else
# If no install manifest found
echo Did not find $ORIGINAL_DIR/build/install_manifest.txt
confirm "(re)install and uninstall? [y/n]" && install_and_uninstall
fi
fi
cd $ORIGINAL_DIR
# Clean up
rm -rf build