diff options
| author | Adam Vandenberg | 2012-03-21 22:03:21 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2012-03-21 22:03:21 -0700 |
| commit | 6a6e76e2cb0d0ba3dd537bef6f857ebce6c3081b (patch) | |
| tree | 00514c70a88b4ddaabb1b167fbcda94a4905d556 /Library | |
| parent | 4e16a0d007b6c0b4c755acc40fcc1f5a8ab0a184 (diff) | |
| download | homebrew-6a6e76e2cb0d0ba3dd537bef6f857ebce6c3081b.tar.bz2 | |
brew doctor: check for trailing slashes in path
Having path directories with trailing slashes can cause other false
warnings.
Closes #9986.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/doctor.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index 0362b0d2f..a8f85d444 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -36,6 +36,19 @@ def path_folders end +# See https://github.com/mxcl/homebrew/pull/9986 +def check_path_for_trailing_slashes + bad_paths = ENV['PATH'].split(':').select{|p| p[p.length-1, p.length] == '/'} + return if bad_paths.empty? + s = <<-EOS.undent + Some directories in your path end in a slash. + Directories in your path should not end in a slash. This can break other + doctor checks. The following directories should be edited: + EOS + bad_paths.each{|p| s << " #{p}"} + s +end + # Installing MacGPG2 interferes with Homebrew in a big way # http://sourceforge.net/projects/macgpg2/files/ def check_for_macgpg2 |
