From 165f964833d059c46f59ccc3149ba7dd069cedc2 Mon Sep 17 00:00:00 2001 From: yahavi Date: Wed, 13 Sep 2023 11:55:22 +0300 Subject: [PATCH] Improve download scripts --- build/getcli/jf.sh | 7 +++---- build/getcli/jfrog.sh | 7 +++---- build/installcli/jf.sh | 7 +++---- build/installcli/jfrog.sh | 7 +++---- build/setupcli/jf.sh | 7 +++---- 5 files changed, 15 insertions(+), 20 deletions(-) diff --git a/build/getcli/jf.sh b/build/getcli/jf.sh index 177e476c8..7b1f5eeff 100644 --- a/build/getcli/jf.sh +++ b/build/getcli/jf.sh @@ -1,7 +1,6 @@ #!/bin/bash CLI_OS="na" -CLI_UNAME="na" CLI_MAJOR_VER="v2-jf" VERSION="[RELEASE]" @@ -13,11 +12,11 @@ else echo "Downloading the latest version of JFrog CLI..." fi -if $(echo "${OSTYPE}" | grep -q msys); then +if echo "${OSTYPE}" | grep -q msys; then CLI_OS="windows" URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-windows-amd64/jf.exe" FILE_NAME="jf.exe" -elif $(echo "${OSTYPE}" | grep -q darwin); then +elif echo "${OSTYPE}" | grep -q darwin; then CLI_OS="mac" if [[ $(uname -m) == 'arm64' ]]; then URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-mac-arm64/jf" @@ -52,7 +51,7 @@ else ;; *) echo "Unknown machine type: $MACHINE_TYPE" - exit -1 + exit 1 ;; esac URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-${CLI_OS}-${ARCH}/jf" diff --git a/build/getcli/jfrog.sh b/build/getcli/jfrog.sh index 6f09e17a7..1debb922e 100644 --- a/build/getcli/jfrog.sh +++ b/build/getcli/jfrog.sh @@ -1,7 +1,6 @@ #!/bin/bash CLI_OS="na" -CLI_UNAME="na" CLI_MAJOR_VER="v2" VERSION="[RELEASE]" @@ -13,11 +12,11 @@ else echo "Downloading the latest version of JFrog CLI..." fi -if $(echo "${OSTYPE}" | grep -q msys); then +if echo "${OSTYPE}" | grep -q msys; then CLI_OS="windows" URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-windows-amd64/jfrog.exe" FILE_NAME="jfrog.exe" -elif $(echo "${OSTYPE}" | grep -q darwin); then +elif echo "${OSTYPE}" | grep -q darwin; then CLI_OS="mac" if [[ $(uname -m) == 'arm64' ]]; then URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-mac-arm64/jfrog" @@ -52,7 +51,7 @@ else ;; *) echo "Unknown machine type: $MACHINE_TYPE" - exit -1 + exit 1 ;; esac URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-${CLI_OS}-${ARCH}/jfrog" diff --git a/build/installcli/jf.sh b/build/installcli/jf.sh index 134359c9b..b3a8c5009 100755 --- a/build/installcli/jf.sh +++ b/build/installcli/jf.sh @@ -1,7 +1,6 @@ #!/bin/bash CLI_OS="na" -CLI_UNAME="na" CLI_MAJOR_VER="v2-jf" VERSION="[RELEASE]" # Order is by destination priority. @@ -16,11 +15,11 @@ else fi echo "" -if $(echo "${OSTYPE}" | grep -q msys); then +if echo "${OSTYPE}" | grep -q msys; then CLI_OS="windows" URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-windows-amd64/jf.exe" FILE_NAME="jf.exe" -elif $(echo "${OSTYPE}" | grep -q darwin); then +elif echo "${OSTYPE}" | grep -q darwin; then CLI_OS="mac" if [[ $(uname -m) == 'arm64' ]]; then URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-mac-arm64/jf" @@ -55,7 +54,7 @@ else ;; *) echo "Unknown machine type: $MACHINE_TYPE" - exit -1 + exit 1 ;; esac URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-${CLI_OS}-${ARCH}/jf" diff --git a/build/installcli/jfrog.sh b/build/installcli/jfrog.sh index a8359af1e..fe1d0695b 100755 --- a/build/installcli/jfrog.sh +++ b/build/installcli/jfrog.sh @@ -1,7 +1,6 @@ #!/bin/bash CLI_OS="na" -CLI_UNAME="na" CLI_MAJOR_VER="v2" VERSION="[RELEASE]" # Order is by destination priority. @@ -16,11 +15,11 @@ else fi echo "" -if $(echo "${OSTYPE}" | grep -q msys); then +if echo "${OSTYPE}" | grep -q msys; then CLI_OS="windows" URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-windows-amd64/jfrog.exe" FILE_NAME="jfrog.exe" -elif $(echo "${OSTYPE}" | grep -q darwin); then +elif echo "${OSTYPE}" | grep -q darwin; then CLI_OS="mac" if [[ $(uname -m) == 'arm64' ]]; then URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-mac-arm64/jfrog" @@ -55,7 +54,7 @@ else ;; *) echo "Unknown machine type: $MACHINE_TYPE" - exit -1 + exit 1 ;; esac URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-${CLI_OS}-${ARCH}/jfrog" diff --git a/build/setupcli/jf.sh b/build/setupcli/jf.sh index d8a7493a4..37a70b6fe 100755 --- a/build/setupcli/jf.sh +++ b/build/setupcli/jf.sh @@ -1,7 +1,6 @@ #!/bin/bash CLI_OS="na" -CLI_UNAME="na" CLI_MAJOR_VER="v2-jf" VERSION="[RELEASE]" # Order is by destination priority. @@ -20,11 +19,11 @@ then fi echo "Downloading the latest version of JFrog CLI..." -if $(echo "${OSTYPE}" | grep -q msys); then +if echo "${OSTYPE}" | grep -q msys; then CLI_OS="windows" URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-windows-amd64/jf.exe" FILE_NAME="jf.exe" -elif $(echo "${OSTYPE}" | grep -q darwin); then +elif echo "${OSTYPE}" | grep -q darwin; then CLI_OS="mac" if [[ $(uname -m) == 'arm64' ]]; then URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-mac-arm64/jf" @@ -59,7 +58,7 @@ else ;; *) echo "Unknown machine type: $MACHINE_TYPE" - exit -1 + exit 1 ;; esac URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-${CLI_OS}-${ARCH}/jf"