Warning for bin dirs not in the PATH
Eg. sbin may be part of the formula, but that isn't in the default Mac PATH. Also will avoid bug reports for users who forget to amend their PATH and stick Homebrew somewhere different.
This commit is contained in:
parent
9d63bf9e14
commit
b3c6c3f591
@ -50,6 +50,19 @@ def install f
|
|||||||
|
|
||||||
raise "Nothing was installed to #{f.prefix}" unless f.installed?
|
raise "Nothing was installed to #{f.prefix}" unless f.installed?
|
||||||
|
|
||||||
|
# warn the user if stuff was installed outside of their PATH
|
||||||
|
paths = ENV['PATH'].split(':').collect{|p| File.expand_path p}
|
||||||
|
[f.bin, f.sbin].each do |bin|
|
||||||
|
if bin.directory?
|
||||||
|
rootbin = (HOMEBREW_PREFIX+bin.basename).to_s
|
||||||
|
bin = File.expand_path bin
|
||||||
|
unless paths.include? rootbin
|
||||||
|
opoo "#{rootbin} is not in your PATH"
|
||||||
|
puts "You can amend this by altering your ~/.bashrc file"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Keg.new(f.prefix).link
|
Keg.new(f.prefix).link
|
||||||
rescue Exception
|
rescue Exception
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user