fix: take $HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN into account when installing portable ruby

This commit is contained in:
Thomas Vaillant 2022-01-20 16:13:39 +01:00 committed by Mike McQuaid
parent 05b5a2c499
commit ad65d47bee
No known key found for this signature in database
GPG Key ID: 3338A31AFDB1D829

View File

@ -119,9 +119,18 @@ fetch() {
--remote-time
--location
--user-agent "${HOMEBREW_USER_AGENT_CURL}"
--header "Authorization: Bearer ${HOMEBREW_DOCKER_REGISTRY_TOKEN:-QQ==}"
)
if [[ -n "${HOMEBREW_DOCKER_REGISTRY_TOKEN}" ]]
then
curl_args[${#curl_args[*]}]="--header \"Authorization: Bearer ${HOMEBREW_DOCKER_REGISTRY_TOKEN}\""
elif [[ -n "${HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN}" ]]
then
curl_args[${#curl_args[*]}]="--header \"Authorization: Basic ${HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN}\""
else
curl_args[${#curl_args[*]}]="--header \"Authorization: Bearer QQ==\""
fi
if [[ -n "${HOMEBREW_QUIET}" ]]
then
curl_args[${#curl_args[*]}]="--silent"