diff --git a/bin/brew b/bin/brew index 32343baa25..9a06b0911c 100755 --- a/bin/brew +++ b/bin/brew @@ -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}" ]]