Fix ZSH FPATH handling

Don't require it to be exported but shell out to `zsh` instead.

Fixes https://github.com/Homebrew/brew/issues/9387
This commit is contained in:
Mike McQuaid 2020-12-03 16:52:54 +00:00
parent 5ad949672f
commit ac84a4b051
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70
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