forked from danielcardeenas/whatsapp-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·73 lines (61 loc) · 1.75 KB
/
setup.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
RED='\033[1;31m'
ORANGE='\033[1;33m'
CYAN='\033[0;36m'
NC='\033[0m' # No Color
install_requirements() {
module_requirements="$1"
#printf "pip3 -qqq install -r $module_requirements"
pip3 -qqq install -r $module_requirements
return_code=$?
if [ $return_code != 0 ]; then
printf "${RED}Error:[%d]. Try running it with root privilages\n" $return_code
exit $return_code
fi
}
install_forked_yowsup() {
printf "Installing ${ORANGE}yowsup libraries${NC}\n"
printf "${NC}--------------------------\n"
cd libs/python-axolotl
python3 setup.py -qqq install
wait
cd ../yowsup
python3 setup.py -qqq install
wait
printf "${NC}--------------------------\n"
# Return to root
cd ../../
}
install_modules() {
printf "Configuring modules\n"
printf "${NC}--------------------------\n"
cd modules
for D in *; do
if [ -d "${D}" ] && [ "${D}" != "__pycache__" ]; then
if [ -f ${D}/requirements.txt ]; then
printf "[${CYAN}${D}${NC}] Installing dependencies...\n"
module_requirements="${D}/requirements.txt"
install_requirements "$module_requirements"
else
printf "[${CYAN}${D}${NC}] All good...\n"
fi
fi
done
wait
printf "${NC}--------------------------\n"
# Return to root
cd ../
}
install_app_dependencies() {
printf "Configuring framework\n"
printf "${NC}--------------------------\n"
printf "[${CYAN}mac${NC}] Installing dependencies...\n"
app_requirements="app/requirements.txt"
install_requirements "$app_requirements"
wait
}
# Step 1
install_forked_yowsup
# Step 2
install_modules
# Step 3
install_app_dependencies