Skip to content
Permalink
Browse files

fix(script): remove check on release URL

Closes #5480

Signed-off-by: Arief Hidayat <mr.arief.hidayat@gmail.com>
  • Loading branch information...
arief-hidayat committed Mar 22, 2019
1 parent 7cb03fb commit 65193adc10bc50edcf96499b5321c7aab46b796c
Showing with 5 additions and 20 deletions.
  1. +5 −20 scripts/get
@@ -77,32 +77,17 @@ verifySupported() {

# checkDesiredVersion checks if the desired version is available.
checkDesiredVersion() {
# Use the GitHub releases webpage for the project to find the desired version for this project.
local latest_release_url="https://github.com/helm/helm/releases/latest"
local release_url
if [ "x$DESIRED_VERSION" == "x" ]; then
# Get tag from release URL
local latest_release_url="https://github.com/helm/helm/releases/latest"
if type "curl" > /dev/null; then
release_url=$(curl -Ls -o /dev/null -w %{url_effective} $latest_release_url)
TAG=$(curl -Ls -o /dev/null -w %{url_effective} $latest_release_url | grep -oE "[^/]+$" )
elif type "wget" > /dev/null; then
release_url=$(wget $latest_release_url --server-response -O /dev/null 2>&1 | awk '/^ Location: /{DEST=$2} END{ print DEST}')
TAG=$(wget $latest_release_url --server-response -O /dev/null 2>&1 | awk '/^ Location: /{DEST=$2} END{ print DEST}' | grep -oE "[^/]+$")
fi
else
release_url="https://github.com/helm/helm/releases/${DESIRED_VERSION}"
TAG=$DESIRED_VERSION
fi

local status_code
if type "curl" > /dev/null; then
status_code=$(curl --write-out %{http_code} --silent --output /dev/null $release_url)
elif type "wget" > /dev/null; then
status_code=$(wget --spider -S $release_url -O /dev/null 2>&1 | grep "HTTP/" | awk '{print $2}')
fi

if [[ "$status_code" -ne 200 ]] ; then
echo "Cannot determine ${DESIRED_VERSION} tag."
exit 1
fi

TAG=$(echo $release_url | grep -oE "[^/]+$" )
}

# checkHelmInstalledVersion checks which version of helm is installed and

0 comments on commit 65193ad

Please sign in to comment.
You can’t perform that action at this time.