-
-
Notifications
You must be signed in to change notification settings - Fork 514
/
install2.sh
45 lines (40 loc) · 1.12 KB
/
install2.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=$PREFIX/bin
dir=$(pwd)
normal='\e[0m'
if [ -e $bin/git ]; then
echo -e "\u001b[32mSkip install git but already installed!"
else
echo -e "\u001b[31mInstaling \u001b[31mgit!"
pkg install nodejs -y
echo -e "\u001b[32mDone install git!"
fi
echo -e "\u001b[33mChecking instalation!"
check() {
if [ -e $bin/git ]; then
echo -e "\u001b[32mGit already installed!"
else
echo -e "\u001b[31mGit not installed!!, install manualy using `pkg install git -y` or `apt install git -y` and after that, type `bash install2.sh`"
exit 1
fi
}
check
echo -e "\u001b[32mDone checking instalation!"
echo -e "\u001b[36mCloning reposito!"
git clone https://github.com/BochilGaming/games-wabot.git games-wabot
if [ -d $dir/games-wabot ]; then
echo -e "\u001b[36mDone clone reposito!"
else
echo -e "\u001b[31mFail to clone reposito!"
exit 1
fi
echo -e "\u001b[36mChange working directory!"
cd games-wabot
main_dir=$(pwd)
if [ $main_dir != $dir ]; then
echo -e "\u001b[36mDone change working directory!"
echo -e "\u001b[36mInstalling bot!"
bash install.sh
else
echo -e "\u001b[31mFail to change working directory!!"
exit 1
fi