Skip to content

Commit 77d7d72

Browse files
committed
download from a known GH location when specifying version
Latest still uses the GH API
1 parent 9de4152 commit 77d7d72

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

install-binary.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,17 @@ verifySupported() {
6666

6767
# getDownloadURL checks the latest available version.
6868
getDownloadURL() {
69-
local url="https://api.github.com/repos/$PROJECT_GH/releases/latest"
7069
local version=$(git -C $HELM_PLUGIN_PATH describe --tags --exact-match 2>/dev/null)
7170
if [ -n "$version" ]; then
72-
url="https://api.github.com/repos/$PROJECT_GH/releases/tags/$version"
73-
fi
74-
# Use the GitHub API to find the download url for this project.
75-
if type "curl" > /dev/null; then
76-
DOWNLOAD_URL=$(curl -s $url | grep $OS | awk '/\"browser_download_url\":/{gsub( /[,\"]/,"", $2); print $2}')
77-
elif type "wget" > /dev/null; then
78-
DOWNLOAD_URL=$(wget -q -O - $url | grep $OS | awk '/\"browser_download_url\":/{gsub( /[,\"]/,"", $2); print $2}')
71+
DOWNLOAD_URL="https://github.com/$PROJECT_GH/releases/download/$version/helm-diff-$OS.tgz"
72+
else
73+
# Use the GitHub API to find the download url for this project.
74+
local url="https://api.github.com/repos/$PROJECT_GH/releases/latest"
75+
if type "curl" > /dev/null; then
76+
DOWNLOAD_URL=$(curl -s $url | grep $OS | awk '/\"browser_download_url\":/{gsub( /[,\"]/,"", $2); print $2}')
77+
elif type "wget" > /dev/null; then
78+
DOWNLOAD_URL=$(wget -q -O - $url | grep $OS | awk '/\"browser_download_url\":/{gsub( /[,\"]/,"", $2); print $2}')
79+
fi
7980
fi
8081
}
8182

0 commit comments

Comments
 (0)