Merge pull request #11930 from XuehaiPan/master

Show all export statements on `brew shellenv` if users modified `PATH` explicitly
This commit is contained in:
Carlo Cabrera 2021-09-08 10:22:50 +08:00 committed by GitHub
commit 5c602003f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,8 @@
# HOMEBREW_REPOSITORY is set by bin/brew
# shellcheck disable=SC2154
homebrew-shellenv() {
[[ "${HOMEBREW_SHELLENV_PREFIX}" == "${HOMEBREW_PREFIX}" ]] && return
[[ "${HOMEBREW_SHELLENV_PREFIX}" == "${HOMEBREW_PREFIX}" &&
"$(PATH="${HOMEBREW_PATH}" command -v brew)" == "${HOMEBREW_PREFIX}/bin/brew" ]] && return
case "$(/bin/ps -p "${PPID}" -c -o comm=)" in
fish | -fish)