Be more verbose for the /usr/bin /usr/local/bin PATH doctor
This commit is contained in:
parent
2759dcf06b
commit
83e9dbf266
@ -349,15 +349,20 @@ def check_user_path
|
|||||||
unless seen_prefix_bin
|
unless seen_prefix_bin
|
||||||
# only show the doctor message if there are any conflicts
|
# only show the doctor message if there are any conflicts
|
||||||
# rationale: a default install should not trigger any brew doctor messages
|
# rationale: a default install should not trigger any brew doctor messages
|
||||||
if Dir["#{HOMEBREW_PREFIX}/bin/*"].any? {|fn| File.exist? "/usr/bin/#{File.basename fn}"}
|
conflicts = Dir["#{HOMEBREW_PREFIX}/bin/*"].
|
||||||
|
select {|fn| File.exist? "/usr/bin/#{File.basename fn}"}.
|
||||||
|
map {|fn| File.basename fn}
|
||||||
|
if conflicts.size
|
||||||
ohai "/usr/bin occurs before #{HOMEBREW_PREFIX}/bin"
|
ohai "/usr/bin occurs before #{HOMEBREW_PREFIX}/bin"
|
||||||
puts <<-EOS.undent
|
puts <<-EOS.undent
|
||||||
This means that system-provided programs will be used instead of those
|
This means that system-provided programs will be used instead of those
|
||||||
provided by Homebrew. This is an issue if you eg. brew installed Python.
|
provided by Homebrew. The following tools exist at both paths:
|
||||||
|
|
||||||
Consider editing your .bashrc to put:
|
#{conflicts * "\n "}
|
||||||
#{HOMEBREW_PREFIX}/bin
|
|
||||||
|
Consider editing your .bashrc to put #{HOMEBREW_PREFIX}/bin
|
||||||
ahead of /usr/bin in your PATH.
|
ahead of /usr/bin in your PATH.
|
||||||
|
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user