diff --git a/install-binary.sh b/install-binary.sh index e8c3c12e..f773cd56 100755 --- a/install-binary.sh +++ b/install-binary.sh @@ -66,16 +66,17 @@ verifySupported() { # getDownloadURL checks the latest available version. getDownloadURL() { - local url="https://api.github.com/repos/$PROJECT_GH/releases/latest" local version=$(git -C $HELM_PLUGIN_PATH describe --tags --exact-match 2>/dev/null) if [ -n "$version" ]; then - url="https://api.github.com/repos/$PROJECT_GH/releases/tags/$version" - fi - # Use the GitHub API to find the download url for this project. - if type "curl" > /dev/null; then - DOWNLOAD_URL=$(curl -s $url | grep $OS | awk '/\"browser_download_url\":/{gsub( /[,\"]/,"", $2); print $2}') - elif type "wget" > /dev/null; then - DOWNLOAD_URL=$(wget -q -O - $url | grep $OS | awk '/\"browser_download_url\":/{gsub( /[,\"]/,"", $2); print $2}') + DOWNLOAD_URL="https://github.com/$PROJECT_GH/releases/download/$version/helm-diff-$OS.tgz" + else + # Use the GitHub API to find the download url for this project. + local url="https://api.github.com/repos/$PROJECT_GH/releases/latest" + if type "curl" > /dev/null; then + DOWNLOAD_URL=$(curl -s $url | grep $OS | awk '/\"browser_download_url\":/{gsub( /[,\"]/,"", $2); print $2}') + elif type "wget" > /dev/null; then + DOWNLOAD_URL=$(wget -q -O - $url | grep $OS | awk '/\"browser_download_url\":/{gsub( /[,\"]/,"", $2); print $2}') + fi fi }