From 65d6d94b6c39a116984f33f4812d91d0896346b0 Mon Sep 17 00:00:00 2001 From: Filip Tibell Date: Tue, 26 Mar 2024 13:53:43 +0100 Subject: [PATCH] Make sure zip file is downloaded --- scripts/install.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/install.sh b/scripts/install.sh index 7cb728e..dce2db7 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -58,9 +58,13 @@ if [ -z "$RELEASE_DOWNLOAD_URL" ]; then exit 1 fi -# Download the file using curl +# Download the file using curl and make sure it was successful ZIP_FILE=$(echo "$RELEASE_DOWNLOAD_URL" | rev | cut -d '/' -f 1 | rev) curl --proto '=https' --tlsv1.2 -L -o "$ZIP_FILE" -sSf --connect-timeout 10 --max-time 60 "$RELEASE_DOWNLOAD_URL" +if [ ! -f "$ZIP_FILE" ]; then + echo "Error: Failed to download the release archive '$ZIP_FILE'." >&2 + exit 1 +fi # Unzip only the specific file we want and make sure it was successful echo "Unzipping '$ZIP_FILE'..."