-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.sh
45 lines (38 loc) · 1.02 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
#!/bin/bash
GREEN='\033[0;32m'
RED='\033[0;101m'
NC='\033[0m'
bold=$(tput bold)
normal=$(tput sgr0)
echo "A Big Thanks for using BASIC!"
echo "Please share your review with rudrad200@gmail.com"
echo ""
echo -n "Do you want to remove the installation files? [y|N]" && read option
if [ "$option" == "y" ]
then
rm -rf $BASIC_DIR
if [ $? -eq 0 ]
then
echo -e "${GREEN}Installation files removed${NC}"
else
echo -e "${RED}Remove failed${NC}"
echo -e "Please manually remove ${bold}$BASIC_DIR${normal} directory"
fi
fi
echo -n "Enter your default shell ($SHELL) : " && read shell
if [ -z "$shell" ]
then
SHELL=$SHELL
else
SHELL=$shell
fi
SHELLRC=~/.$(echo $SHELL | grep -Po '(?<=/usr/bin/)(.+)')rc
echo "SHELLRC: $SHELLRC"
sed -i '/BASIC.*/d' $SHELLRC
if [ $? -eq 0 ]
then
echo -e "${GREEN}Uninstall successful${NC}"
else
echo -e "${RED}Uninstall failed${NC}"
echo -e "Please manually remove all the lines containing ${bold}'### BASIC ###'${normal} from ${bold}$SHELLRC${normal}"
fi