Skip to content

Commit

Permalink
Use zipfile when installing in Windows
Browse files Browse the repository at this point in the history
The release for Windows is bundled in a zipfile instead of a tarball.
This change fixes the download URL in Windows to use .zip instead of .tar.gz
  • Loading branch information
alemorcuq committed Jan 15, 2024
1 parent 597660d commit 17803a8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions install-binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ initOS() {
Darwin) OS='darwin' ;;
Linux) OS='linux' ;;
esac

EXT=
}

# verifySupported checks that the os/arch combination is supported for
Expand All @@ -83,10 +85,14 @@ verifySupported() {
# getDownloadURL checks the latest available version.
getDownloadURL() {
version="$(< "$HELM_PLUGIN_DIR/$PLUGIN_MANIFEST" grep "version" | cut -d '"' -f 2)"
ext="tar.gz"
if [ "$OS" = "windows" ]; then
ext="zip"
fi
if [ "$SCRIPT_MODE" = "install" ] && [ -n "$version" ]; then
DOWNLOAD_URL="https://github.com/${PROJECT_GH}/releases/download/v${version}/${PROJECT_NAME}_${version}_${OS}_${ARCH}.tar.gz"
DOWNLOAD_URL="https://github.com/${PROJECT_GH}/releases/download/v${version}/${PROJECT_NAME}_${version}_${OS}_${ARCH}.${ext}"
else
DOWNLOAD_URL="https://github.com/${PROJECT_GH}/releases/latest/download/${PROJECT_NAME}_${version}_${OS}_${ARCH}.tar.gz"
DOWNLOAD_URL="https://github.com/${PROJECT_GH}/releases/latest/download/${PROJECT_NAME}_${version}_${OS}_${ARCH}.${ext}"
fi
}

Expand Down

0 comments on commit 17803a8

Please sign in to comment.