-
Notifications
You must be signed in to change notification settings - Fork 0
/
batbelt.install.sh
57 lines (44 loc) · 2.08 KB
/
batbelt.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
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo "Not Supported yet"
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "Downloading cloudflared (for tunneling)"
which wget; wget -q --show-progress https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-darwin-amd64.tgz -O cloudflared-darwin-amd64.tgz
if [ ! -f cloudflared-darwin-amd64.tgz ]; then
which curl; curl --progress-bar -L -o cloudflared-darwin-amd64.tgz https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-darwin-amd64.tgz
fi
tar -xf cloudflared-darwin-amd64.tgz
rm cloudflared-darwin-amd64.tgz
mv cloudflared /usr/local/bin/cloudflared
if [ ! -f /usr/local/bin/cloudflared ]; then
echo "Downloading cloudflared failed. Your connection might be unstable, please try again later."
rm cloudflared-darwin-amd64.tgz
exit 1
fi
echo "Downloading batServe"
which wget; wget -q --show-progress https://github.com/notai-tech/batbelt/releases/latest/download/batbelt-darwin-amd64.tar -O batbelt-darwin-amd64.tar
if [ ! -f batbelt-darwin-amd64.tar ]; then
which curl; curl --progress-bar -L -o batbelt-darwin-amd64.tar https://github.com/notai-tech/batbelt/releases/latest/download/batbelt-darwin-amd64.tar
fi
tar -xf batbelt-darwin-amd64.tar
if [ -d /usr/local/bin/batbelt_libs ]; then
rm -rf /usr/local/bin/batbelt_libs
fi
mv batbelt-darwin-amd64/* /usr/local/bin/
rm -rf batbelt-darwin-amd64 batbelt-darwin-amd64.tar
if [ ! -f /usr/local/bin/batbelt ]; then
echo "Downloading batbelt failed. Your connection might be unstable, please try again later."
exit 1
fi
chmod +x /usr/local/bin/batbelt
echo "Start batserve by running 'batbelt serve'"
elif [[ "$OSTYPE" == "cygwin" ]]; then
echo "Not Supported yet"
elif [[ "$OSTYPE" == "msys" ]]; then
echo "Not Supported yet"
elif [[ "$OSTYPE" == "win32" ]]; then
echo "Not Supported yet"
elif [[ "$OSTYPE" == "freebsd"* ]]; then
echo "Not Supported yet"
else
echo "Not Supported yet"
fi