From 4d4d66d0cb831cc705b3c5ae965a0d5684f753ec Mon Sep 17 00:00:00 2001 From: Alejandro Moreno Date: Mon, 15 Jan 2024 11:31:38 +0100 Subject: [PATCH 1/3] Use zipfile when installing in Windows 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 --- install-binary.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/install-binary.sh b/install-binary.sh index 85627af..107095b 100755 --- a/install-binary.sh +++ b/install-binary.sh @@ -83,10 +83,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 } From 3e0ac85034d1d437d548ce2038ab85f114ed5652 Mon Sep 17 00:00:00 2001 From: Alejandro Moreno Date: Mon, 15 Jan 2024 13:06:57 +0100 Subject: [PATCH 2/3] Use unzip for Windows --- install-binary.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install-binary.sh b/install-binary.sh index 107095b..ed2e938 100755 --- a/install-binary.sh +++ b/install-binary.sh @@ -123,10 +123,12 @@ downloadFile() { # installFile verifies the SHA256 for the file, then unpacks and # installs it. installFile() { - tar xzf "$PLUGIN_TMP_FILE" -C "$HELM_TMP" HELM_TMP_BIN="$HELM_TMP/$BINARY_NAME" if [ "${OS}" = "windows" ]; then HELM_TMP_BIN="$HELM_TMP_BIN.exe" + unzip "$PLUGIN_TMP_FILE" -d "$HELM_TMP" + else + tar xzf "$PLUGIN_TMP_FILE" -C "$HELM_TMP" fi echo "Preparing to install into ${HELM_PLUGIN_DIR}" mkdir -p "$HELM_PLUGIN_DIR/bin" From afa5c2dcc3088ec047778973b225ebef7a79a283 Mon Sep 17 00:00:00 2001 From: Alejandro Moreno Date: Mon, 15 Jan 2024 13:52:04 +0100 Subject: [PATCH 3/3] Add Windows installation note to readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 6b4dd62..9b6d145 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,10 @@ Provided you have [Helm](https://helm.sh) then you can install this tool as a pl $ helm plugin install https://github.com/vmware-labs/distribution-tooling-for-helm ``` +> **Note:** Windows installation +> +> If installing on Windows, the above command must be run in a bash emulator such as Git Bash. + ### Downloading and using standalone Fetch the latest available release from the [Releases](https://github.com/vmware-labs/distribution-tooling-for-helm/releases) section.