From ad65d47bee0bf1e1c2f41f7e94ead4fdcf13a26a Mon Sep 17 00:00:00 2001 From: Thomas Vaillant Date: Thu, 20 Jan 2022 16:13:39 +0100 Subject: [PATCH] fix: take $HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN into account when installing portable ruby --- Library/Homebrew/cmd/vendor-install.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/vendor-install.sh b/Library/Homebrew/cmd/vendor-install.sh index 1cda2e6a71..64afe43deb 100644 --- a/Library/Homebrew/cmd/vendor-install.sh +++ b/Library/Homebrew/cmd/vendor-install.sh @@ -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"