mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
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:
parent
5ad949672f
commit
ac84a4b051
@ -133,7 +133,8 @@ class Caveats
|
|||||||
zsh #{installed.join(" and ")} have been installed to:
|
zsh #{installed.join(" and ")} have been installed to:
|
||||||
#{site_functions}
|
#{site_functions}
|
||||||
EOS
|
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
|
zsh_caveats << <<~EOS
|
||||||
|
|
||||||
#{site_functions} is not in your zsh FPATH!
|
#{site_functions} is not in your zsh FPATH!
|
||||||
|
2
bin/brew
2
bin/brew
@ -62,7 +62,7 @@ HOMEBREW_LIBRARY="$HOMEBREW_REPOSITORY/Library"
|
|||||||
|
|
||||||
# Copy and export all HOMEBREW_* variables previously mentioned in
|
# Copy and export all HOMEBREW_* variables previously mentioned in
|
||||||
# manpage or used elsewhere by Homebrew.
|
# 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
|
do
|
||||||
# Skip if variable value is empty.
|
# Skip if variable value is empty.
|
||||||
[[ -z "${!VAR}" ]] && continue
|
[[ -z "${!VAR}" ]] && continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user