Merge pull request #9480 from MikeMcQuaid/caveats-zsh-remove

caveats: remove ZSH FPATH logic.
This commit is contained in:
Mike McQuaid 2020-12-09 12:45:58 +00:00 committed by GitHub
commit 7b2eb23f55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,21 +128,10 @@ class Caveats
#{root_dir}/etc/bash_completion.d #{root_dir}/etc/bash_completion.d
EOS EOS
when :zsh when :zsh
site_functions = root_dir/"share/zsh/site-functions" <<~EOS
zsh_caveats = +<<~EOS
zsh #{installed.join(" and ")} have been installed to: zsh #{installed.join(" and ")} have been installed to:
#{site_functions} #{root_dir}/share/zsh/site-functions
EOS EOS
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!
Add it by following these steps:
#{Formatter.url("https://docs.brew.sh/Shell-Completion#configuring-completions-in-zsh")}
EOS
end
zsh_caveats.freeze
when :fish when :fish
fish_caveats = +"fish #{installed.join(" and ")} have been installed to:" fish_caveats = +"fish #{installed.join(" and ")} have been installed to:"
fish_caveats << "\n #{root_dir}/share/fish/vendor_completions.d" if completion_installed fish_caveats << "\n #{root_dir}/share/fish/vendor_completions.d" if completion_installed