-
Notifications
You must be signed in to change notification settings - Fork 2
/
Installer.sh
executable file
·87 lines (72 loc) · 2.37 KB
/
Installer.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
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
#!/bin/bash
# *********************** #
# Functions Definitions :
# *********************** #
pulling () {
loading &
pid=$!
git pull 1> /dev/null
sleep 2
pullCheck
kill $pid
wait $pid 2>/dev/null
echo ""
}
loading () {
echo ""
echo -n " "
while [ 1 ]
do
echo -ne "█"
sleep 0.1
done
}
pullCheck () {
printf "\n\n"
if [ $? == "0" ]
then
echo -e " \x1b[32m ... Update DONE ... \033[m"
else
echo -e " \x1b[31m ... Update FAILED ... \033[m"
fi
}
# *********************** #
# Header Printing :
# *********************** #
printf "\n"
printf "░█████╗░██████╗░██████╗░ ░██████╗░███████╗███╗░░██╗
██╔══██╗██╔══██╗██╔══██╗ ██╔════╝░██╔════╝████╗░██║
██║░░╚═╝██████╔╝██████╔╝ ██║░░██╗░█████╗░░██╔██╗██║
██║░░██╗██╔═══╝░██╔═══╝░ ██║░░╚██╗██╔══╝░░██║╚████║
╚█████╔╝██║░░░░░██║░░░░░ ╚██████╔╝███████╗██║░╚███║
░╚════╝░╚═╝░░░░░╚═╝░░░░░ ░╚═════╝░╚══════╝╚═╝░░╚══╝\033[m\n"
printf "\n By : \x1b[33mmarbenMB\033[m [mbenbajj]\n"
echo ""
echo "------------------------------------------------------"
printf " Usage Command : \x1b[32mCppGen\033[m\n"
echo "------------------------------------------------------"
# *********************** #
# Command Installation :
# *********************** #
echo ""
echo -e " \x1b[32m ... Installation ... \033[m"
echo -e " \x1b[33m ..... Updating ..... \033[m"
pulling
# *********************** #
# Command Existance :
# *********************** #
cat ~/.zshrc | grep -c CppGen 1> /dev/null
if [ $? == "1" ]
then
cp Cpp_OrthodoxGenerator.sh ~
echo "alias CppGen='bash ~/Cpp_OrthodoxGenerator.sh'" >> ~/.zshrc
if [ $? == "0" ]
then
echo -e " \x1b[32mInstallation DONE :D\033[m"
else
echo -e " \x1b[31m Installation FAILED \033[m"
fi
else
echo -e " \x1b[33mAlready Installed :D \033[m"
fi
echo ""