Skip to content

Commit

Permalink
Fix curl_init and CURL_WRAP var settings
Browse files Browse the repository at this point in the history
  • Loading branch information
taoky committed Dec 4, 2024
1 parent 9add1fd commit b698e54
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions homebrew-bottles/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ mkdir -p "$TO/api/cask-source"
BOTTLES=$(mktemp)
CASK_SOURCES=$(mktemp)

curl_init

BOTTLES_BIND_ADDRESS="$BIND_ADDRESS"

# Step 1: Download new API jsons and extract
Expand All @@ -36,6 +34,8 @@ if [ -n "$BREW_SH_BIND_ADDRESS" ]; then
BIND_ADDRESS="$BREW_SH_BIND_ADDRESS"
fi

curl_init

for file in "${FILES[@]}"; do
$CURL_WRAP --compressed -sSL -o "$TO/api/$file".tmp "$URL_BASE/$file"
if [[ $? -ne 0 ]]; then
Expand Down Expand Up @@ -102,8 +102,12 @@ Accept: application/vnd.oci.image.index.v1+json
Authorization: Bearer QQ==
EOF

# parallel downloading
# Reset BIND_ADDRESS and curl for bottle downloading
BIND_ADDRESS="$BOTTLES_BIND_ADDRESS"
unset CURL_WRAP
curl_init

# parallel downloading
export by_hash=$(realpath $TO/.by-hash)
export local_dir=$TO
export CURL_WRAP="$CURL_WRAP --header @$headers_file"
Expand Down

0 comments on commit b698e54

Please sign in to comment.