Merge pull request #13593 from MikeMcQuaid/no_user_homebrew_path

bin/brew: never use HOMEBREW_PATH from users.
This commit is contained in:
Mike McQuaid 2022-07-22 11:27:18 +01:00 committed by GitHub
commit b62c271be5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,7 +75,7 @@ HOMEBREW_LIBRARY="${HOMEBREW_REPOSITORY}/Library"
# Copy and export all HOMEBREW_* variables previously mentioned in
# manpage or used elsewhere by Homebrew.
for VAR in BAT_THEME BROWSER DISPLAY EDITOR NO_COLOR PATH TMUX DBUS_SESSION_BUS_ADDRESS
for VAR in BAT_THEME BROWSER DISPLAY EDITOR NO_COLOR TMUX DBUS_SESSION_BUS_ADDRESS
do
# Skip if variable value is empty.
[[ -z "${!VAR}" ]] && continue
@ -109,6 +109,11 @@ then
export CI="1"
fi
# save the existing user path as HOMEBREW_PATH so it can be queried by
# e.g. brew doctor later.
HOMEBREW_PATH="${PATH}"
export HOMEBREW_PATH
# set from user environment
# shellcheck disable=SC2154
if [[ -z "${HOMEBREW_NO_ENV_FILTERING}" ]]