-
Notifications
You must be signed in to change notification settings - Fork 2
/
install.sh
62 lines (41 loc) · 1.62 KB
/
install.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
54
55
56
57
58
59
60
61
62
#!/bin/bash
RED='\033[0;31m'
CYAN='\033[0;36m'
GREEN='\033[0;32m'
HEART_ICON='\u2665'
NC='\033[0m' # No Color
echo -e "${GREEN}[INFO] Start TosChat installation\n${NC}"
echo -e "${GREEN}[INFO] Cloning toschat repository\n${NC}"
if [ -d "$HOME/toschat" ]; then # if toschat exists in home dir, remove
rm -rf "$HOME/toschat"
fi
repo_url="https://github.com/MuongKimhong/toschat.git"
git clone "$repo_url" "$HOME/toschat"
echo -e "${GREEN}[INFO] Creating TosChat python3 environment...\n${NC}"
if [ -d "$HOME/toschat/.venv" ]; then # if .venv/ exists in home dir, remove
rm -rf "$HOME/toschat/.venv"
fi
python3 -m venv $HOME/toschat/.venv
source $HOME/toschat/.venv/bin/activate
pip3 install -r $HOME/toschat/requirements.txt
# only download toschat.sh to /usr/local/bin if it doesn't exist
if [ ! -f "/usr/local/bin/toschat" ]; then
# Download toschat.sh
echo -e "${GREEN}[INFO] Setting up toschat...\n${NC}"
sudo curl -o /usr/local/bin/toschat "https://raw.githubusercontent.com/MuongKimhong/toschat/master/toschat.sh"
sudo chmod +x /usr/local/bin/toschat
fi
# remove server dir and websocket dir
if [ -d "$HOME/toschat/server" ]; then
rm -rf "$HOME/toschat/server"
fi
if [ -d "$HOME/toschat/websocket" ]; then
rm -rf "$HOME/toschat/websocket"
fi
if [ "$(uname)" == "Linux" ]; then
sudo apt-get install xdotool
fi
echo -e "${CYAN}[INFO] Installation completed\n${NC}"
echo -e "${CYAN}[INFO] To open the application run command: toschat\n${NC}"
echo -e "${CYAN}[Important Message] Code with Love ${HEART_ICON} \n${NC}"
echo -e "${CYAN}Visit https://github.com/MuongKimhong/toschat for more info.${NC}"