diff --git a/script/lib/download-file.sh b/script/lib/download-file.sh index 5e78896..87110c3 100644 --- a/script/lib/download-file.sh +++ b/script/lib/download-file.sh @@ -14,9 +14,21 @@ function download_to { debug_log "about to download" URL="$1" OUTPUT_FILE="$2" - echo "doing curl of: '$URL', saving in $OUTPUT_FILE" + debug_log "doing curl of: '$URL', saving in $OUTPUT_FILE" - HTTP_CODE="$(curl --silent --output "$OUTPUT_FILE" --write-out "%{http_code}" --location "$URL")" + if [[ "$(uname -m)" == "Darwin" ]] || [[ "$(uname -m)" == "Linux" ]]; then + HTTP_CODE="$(curl --silent --output "$OUTPUT_FILE" --write-out "%{http_code}" --location "$URL")" + else + # temp workaround for curl 8.8.x error on windows gha runners + # https://github.com/curl/curl/issues/13845 + curl --silent --output "$OUTPUT_FILE" --location "$URL" + if [ $? -ne 0 ]; then + error "Unable to download file at url ${URL}" + exit 1 + else + HTTP_CODE=200 + fi + fi debug_log "did curl, http code was '${HTTP_CODE}'" if [[ "${HTTP_CODE}" -lt 200 || "${HTTP_CODE}" -gt 299 ]] ; then error "Unable to download file at url ${URL}"