Move "--location" from curl_opts to curl option

Co-authored-by: Augusto Moura <augusto.moura@toptal.com>
This commit is contained in:
ygXXII 2023-02-22 09:38:50 +08:00 committed by GitHub
parent 81b31c0a4d
commit 9ce1bfc6e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,10 +96,10 @@ print_index_tab(){
delete_on_exit "$temp_headers_file"
if [ -r "$etag_file" ]; then
curl_opts=(--location --header "If-None-Match: $(cat "$etag_file")")
curl_opts=(--header "If-None-Match: $(cat "$etag_file")")
fi
index=$(curl --fail --silent --dump-header "$temp_headers_file" ${curl_opts+"${curl_opts[@]}"} "${NODEJS_ORG_MIRROR}index.tab")
index=$(curl --fail --silent --location --dump-header "$temp_headers_file" ${curl_opts+"${curl_opts[@]}"} "${NODEJS_ORG_MIRROR}index.tab")
if [ "$index" ]; then
awk 'tolower($1) == "etag:" { print $2 }' < "$temp_headers_file" > "$etag_file"