diff --git a/homebrew-bottles/sync.sh b/homebrew-bottles/sync.sh index 035ce8b..86ac06f 100755 --- a/homebrew-bottles/sync.sh +++ b/homebrew-bottles/sync.sh @@ -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 @@ -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 @@ -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"