diff options
| author | Max Howell | 2009-09-16 19:28:42 +0100 |
|---|---|---|
| committer | Max Howell | 2009-09-17 18:42:56 +0100 |
| commit | b3c6c3f591806976ec9f327cd4745cfcedcee7b9 (patch) | |
| tree | c9f2770643b2c9a65224c9f633916c31d151659b | |
| parent | 9d63bf9e142ac82bdd8371c5dd3d566b181a53e0 (diff) | |
| download | brew-b3c6c3f591806976ec9f327cd4745cfcedcee7b9.tar.bz2 | |
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.
| -rwxr-xr-x | Library/Homebrew/install.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Library/Homebrew/install.rb b/Library/Homebrew/install.rb index 72fb2a1fa..3b06cf8bc 100755 --- a/Library/Homebrew/install.rb +++ b/Library/Homebrew/install.rb @@ -50,6 +50,19 @@ def install f 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 Keg.new(f.prefix).link rescue Exception |
