Skip to content

Commit cec3213

Browse files
committed
ci(win): workaround for broken curl 8.8.0 --write-out opt
1 parent 46cb62c commit cec3213

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

script/lib/download-file.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,19 @@ function download_to {
1616
OUTPUT_FILE="$2"
1717
debug_log "doing curl of: '$URL', saving in $OUTPUT_FILE"
1818

19-
HTTP_CODE="$(curl --silent --output "$OUTPUT_FILE" --write-out "%{http_code}" --location "$URL")"
19+
if [[ "$(uname -m)" == "Darwin" ]] || [[ "$(uname -m)" == "Linux" ]]; then
20+
HTTP_CODE="$(curl --silent --output "$OUTPUT_FILE" --write-out "%{http_code}" --location "$URL")"
21+
else
22+
# temp workaround for curl 8.8.x error on windows gha runners
23+
# https://github.com/curl/curl/issues/13845
24+
curl --silent --output "$OUTPUT_FILE" --location "$URL"
25+
if [ $? -ne 0 ]; then
26+
error "Unable to download file at url ${URL}"
27+
exit 1
28+
else
29+
HTTP_CODE=200
30+
fi
31+
fi
2032
debug_log "did curl, http code was '${HTTP_CODE}'"
2133
if [[ "${HTTP_CODE}" -lt 200 || "${HTTP_CODE}" -gt 299 ]] ; then
2234
error "Unable to download file at url ${URL}"

0 commit comments

Comments
 (0)