[Library/Homebrew/cmd/update.sh] Release Candidate for pull request
This commit is contained in:
parent
53c261814e
commit
3619636f7f
@ -631,18 +631,25 @@ EOS
|
|||||||
|
|
||||||
# HOMEBREW_UPDATE_FORCE and HOMEBREW_UPDATE_AUTO aren't modified here so ignore subshell warning.
|
# HOMEBREW_UPDATE_FORCE and HOMEBREW_UPDATE_AUTO aren't modified here so ignore subshell warning.
|
||||||
# shellcheck disable=SC2030
|
# shellcheck disable=SC2030
|
||||||
if [[ "${UPSTREAM_REPOSITORY_URL}" =~ https://(([^:@]+)(:([^@]+))?@)?github.com/(.*)$ ]]
|
if [[ "${UPSTREAM_REPOSITORY_URL}" = "https://github.com/"* ]] ||
|
||||||
|
[[ "${UPSTREAM_REPOSITORY_URL}" =~ https://(([^:@]+)(:([^@]+))?@)?github.com/(.*)$ ]]
|
||||||
|
then
|
||||||
|
if [[ -n "${BASH_REMATCH[5]}" ]]
|
||||||
then
|
then
|
||||||
UPSTREAM_REPOSITORY="${BASH_REMATCH[5]%.git}"
|
UPSTREAM_REPOSITORY="${BASH_REMATCH[5]%.git}"
|
||||||
|
else
|
||||||
|
UPSTREAM_REPOSITORY="${UPSTREAM_REPOSITORY_URL#https://github.com/}"
|
||||||
|
UPSTREAM_REPOSITORY="${UPSTREAM_REPOSITORY%.git}"
|
||||||
|
fi
|
||||||
# HOMEBREW_GITHUB_API_TOKEN is optionally defined in the user environment.
|
# HOMEBREW_GITHUB_API_TOKEN is optionally defined in the user environment.
|
||||||
# can be superseded a token from the local repository URL
|
# Global token HOMEBREW_GITHUB_API_TOKEN supersedes local defined one
|
||||||
# shellcheck disable=SC2153
|
# shellcheck disable=SC2153
|
||||||
if [[ -n "${BASH_REMATCH[4]}" ]]
|
if [[ -n "${HOMEBREW_GITHUB_API_TOKEN}" ]]
|
||||||
then
|
|
||||||
CURL_GITHUB_API_ARGS=("--header" "Authorization: token ${BASH_REMATCH[4]}")
|
|
||||||
elif [[ -n "${HOMEBREW_GITHUB_API_TOKEN}" ]]
|
|
||||||
then
|
then
|
||||||
CURL_GITHUB_API_ARGS=("--header" "Authorization: token ${HOMEBREW_GITHUB_API_TOKEN}")
|
CURL_GITHUB_API_ARGS=("--header" "Authorization: token ${HOMEBREW_GITHUB_API_TOKEN}")
|
||||||
|
elif [[ -n "${BASH_REMATCH[4]}" ]]
|
||||||
|
then
|
||||||
|
CURL_GITHUB_API_ARGS=("--header" "Authorization: token ${BASH_REMATCH[4]}")
|
||||||
else
|
else
|
||||||
CURL_GITHUB_API_ARGS=()
|
CURL_GITHUB_API_ARGS=()
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user