Merge pull request #9404 from MikeMcQuaid/zsh-fpath-fixes

Fix ZSH FPATH handling
This commit is contained in:
Mike McQuaid 2020-12-03 19:39:40 +00:00 committed by GitHub
commit 9298e4959b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -133,7 +133,8 @@ class Caveats
zsh #{installed.join(" and ")} have been installed to:
#{site_functions}
EOS
unless PATH.new(ENV["HOMEBREW_FPATH"]).to_a.include?(site_functions.to_s)
zsh = which("zsh") || which("zsh", ENV["HOMEBREW_PATH"])
if zsh.present? && Utils.popen_read("'#{zsh}' -ic 'echo $FPATH'").exclude?(site_functions.to_s)
zsh_caveats << <<~EOS
#{site_functions} is not in your zsh FPATH!

View File

@ -62,7 +62,7 @@ HOMEBREW_LIBRARY="$HOMEBREW_REPOSITORY/Library"
# Copy and export all HOMEBREW_* variables previously mentioned in
# manpage or used elsewhere by Homebrew.
for VAR in BROWSER DISPLAY EDITOR NO_COLOR PATH FPATH
for VAR in BROWSER DISPLAY EDITOR NO_COLOR PATH
do
# Skip if variable value is empty.
[[ -z "${!VAR}" ]] && continue