-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-dependencies.sh
executable file
·88 lines (72 loc) · 2.2 KB
/
install-dependencies.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
#!/usr/bin/env bash
echo "
_________ _ _________ _________ _______ ______ _______ _________
\__ __/( ( /|\__ __/ \__ __/( ____ \ ( ___ \ ( ___ )\__ __/
) ( | \ ( | ) ( ) ( | ( \/ | ( ) )| ( ) | ) (
| | | \ | | | | | | | | | (__/ / | | | | | |
| | | (\ \) | | | | | | | ____ | __ ( | | | | | |
| | | | \ | | | | | | | \_ ) | ( \ \ | | | | | |
| | | ) \ | | | | | | (___) | | )___) )| (___) | | |
)_( |/ )_) )_( )_( (_______) |/ \___/ (_______) )_(
BY URIID1
GITHUB github.com/uriid1/tnt-tg-bot
"
readonly C_RESET="\033[0m"
readonly C_ERROR="\033[1;31m"
readonly C_INFO="\033[1;32m"
readonly C_INSTALL="\033[4;34m"
error() {
printf "Error: ${1} ${C_ERROR}Not found${C_RESET}\n"
}
info() {
printf "Done: ${1} ${C_INFO}Found${C_RESET}\n"
}
install() {
printf "Install ${C_INSTALL}${1}${C_RESET}...\n"
}
basic_programs=(tarantool unzip lua git gcc)
optional_programs=(ldoc luacheck luarocks)
errs=0
for ((i = 0; i < ${#basic_programs[*]}; ++i)); do
programm="${basic_programs[$i]}"
if ! [ "$(which -a $programm . 2>/dev/null)" ]; then
error "${programm}"
errs=$((errs+1))
else
info "${programm}"
fi
done
if [ $errs -ge 1 ]; then
exit 1
fi
for ((i = 0; i < ${#optional_programs[*]}; ++i)); do
programm="${optional_programs[$i]}"
if ! [ "$(which -a $programm . 2>/dev/null)" ]; then
echo "Warning: ${programm} not found"
errs=$((errs+1))
else
info "${programm} (optional)"
fi
done
# Install all rocks
echo
install "http"
tarantoolctl rocks install --server=https://rocks.tarantool.org/ --local http
install "lua-multipart-post"
tarantoolctl rocks install --server=https://luarocks.org lua-multipart-post 1.0-0
while [[ $# -gt 0 ]]; do
case "$1" in
-o | --optional)
install "pimp"
tarantoolctl rocks install --server=https://luarocks.org pimp
shift 1
;;
-hp | --http-patch)
install "escape"
tarantoolctl rocks install --only-server=https://rocks.antibot.ru escape
install "http-patch"
tarantool scripts/http_patch.lua
shift 1
;;
esac
done