Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ZSH FPATH handling #9404

Merged
merged 1 commit into from Dec 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion Library/Homebrew/caveats.rb
Expand Up @@ -133,7 +133,8 @@ def function_completion_caveats(shell)
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!
Expand Down
2 changes: 1 addition & 1 deletion bin/brew
Expand Up @@ -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
Expand Down