forked from jfrog/jfrog-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getCli.sh
37 lines (33 loc) · 1.13 KB
/
getCli.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
#!/bin/bash
CLI_OS="na"
CLI_UNAME="na"
if [ $# -eq 0 ]
then
VERSION=\$latest
echo "Downloading the latest version of JFrog CLI..."
else
VERSION=$1
echo "Downloading version $1 of JFrog CLI..."
fi
if $(echo "${OSTYPE}" | grep -q msys); then
CLI_OS="windows"
URL="https://api.bintray.com/content/jfrog/jfrog-cli-go/${VERSION}/jfrog-cli-windows-amd64/jfrog.exe?bt_package=jfrog-cli-windows-amd64"
FILE_NAME="jfrog.exe"
elif $(echo "${OSTYPE}" | grep -q darwin); then
CLI_OS="mac"
URL="https://api.bintray.com/content/jfrog/jfrog-cli-go/${VERSION}/jfrog-cli-mac-386/jfrog?bt_package=jfrog-cli-mac-386"
FILE_NAME="jfrog"
else
CLI_OS="linux"
if $(uname -m | grep -q 64); then
CLI_UNAME="64"
URL="https://api.bintray.com/content/jfrog/jfrog-cli-go/${VERSION}/jfrog-cli-linux-amd64/jfrog?bt_package=jfrog-cli-linux-amd64"
FILE_NAME="jfrog"
else
CLI_UNAME="32"
URL="https://api.bintray.com/content/jfrog/jfrog-cli-go/${VERSION}/jfrog-cli-linux-386/jfrog?bt_package=jfrog-cli-linux-386"
FILE_NAME="jfrog"
fi
fi
curl -XGET "$URL" -L -k > $FILE_NAME
chmod u+x $FILE_NAME