Skip to content

Commit

Permalink
fix: installation script for curl v8.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Jun 12, 2024
1 parent 6900260 commit d273419
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,26 @@ http_download_curl() {
local_file=$1
source_url=$2
header=$3

# workaround https://github.com/curl/curl/issues/13845
curl_version=$(curl --version | head -n 1 | awk '{ print $2 }')
if [ "$curl_version" = "8.8.0" ]; then
log_debug "http_download_curl curl $curl_version detected"
if [ -z "$header" ]; then
curl -sL -o "$local_file" "$source_url"
else
curl -sL -H "$header" -o "$local_file" "$source_url"

nf=$(cat "$local_file" | jq -r '.error // ""')
if [ ! -z "$nf" ]; then
log_debug "http_download_curl received an error: $nf"
return 1
fi
fi

return 0
fi

if [ -z "$header" ]; then
code=$(curl -w '%{http_code}' -sL -o "$local_file" "$source_url")
else
Expand Down

0 comments on commit d273419

Please sign in to comment.