-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
41 lines (35 loc) · 873 Bytes
/
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
#! /bin/bash
exec_curl(){
echo "Downloading docgen to $2"
curl --connect-timeout 30 --retry-delay 5 --retry 5 -o "$2" "$1"
}
OS=`uname`
ARCH=`uname -m`
VERSION=$1
URL=https://raw.githubusercontent.com/thedevsaddam/docgen-bin/master
TARGET=/usr/local/bin/docgen
MESSAGE_START="Installing docgen"
MESSAGE_END="Installation complete"
if [ "$VERSION" == "" ]; then
VERSION="latest"
fi
if [ "$OS" == "Darwin" ]; then
exec_curl $URL/$VERSION/mac_amd64 $TARGET
echo "$MESSAGE_START"
chmod +x $TARGET
echo "$MESSAGE_END"
docgen
elif [ "$OS" == "Linux" ]; then
if [ "$ARCH" == "x86_64" ]; then
exec_curl $URL/$VERSION/linux_amd64 $TARGET
echo "$MESSAGE_START"
chmod +x $TARGET
echo "$MESSAGE_END"
docgen
fi
if [ "$ARCH" == "i368" ]; then
exec_curl $URL/$VERSION/linux_386 $TARGET
chmod +x $TARGET
docgen
fi
fi