doctor: report if a path element is invalid
Under certain circumstances, an invalid path element would cause File.expand_path to bail out. Catch mistakes and report them, then continue instead. Fixes Homebrew/homebrew#12154
This commit is contained in:
parent
f8a6075af3
commit
71d34a86d6
@ -32,7 +32,12 @@ end
|
|||||||
|
|
||||||
|
|
||||||
def path_folders
|
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
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user