bin/brew: never use HOMEBREW_PATH from users.

Fixes https://github.com/Homebrew/brew/issues/13548
This commit is contained in:
Mike McQuaid 2022-07-22 10:33:43 +01:00
parent e7c3782d03
commit f4103e5d61
No known key found for this signature in database
GPG Key ID: 3338A31AFDB1D829

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}" ]]