aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/doctor.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 1940ff272..33e01f0fc 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -32,7 +32,12 @@ end
def path_folders
- ENV['PATH'].split(':').collect{|p| remove_trailing_slash(File.expand_path(p))}.uniq
+ @path_folders ||= ENV['PATH'].split(':').collect do |p|
+ begin remove_trailing_slash(File.expand_path(p))
+ rescue ArgumentError
+ onoe "The following PATH component is invalid: #{p}"
+ end
+ end.uniq.compact
end