Skip to content
Snippets Groups Projects
Commit 84754716 authored by Jack Nagel's avatar Jack Nagel
Browse files

doctor: rename path_folders to paths

parent 17808550
No related branches found
No related tags found
No related merge requests found
...@@ -46,9 +46,10 @@ def remove_trailing_slash s ...@@ -46,9 +46,10 @@ def remove_trailing_slash s
end end
def path_folders def paths
@path_folders ||= ENV['PATH'].split(':').collect do |p| @paths ||= ENV['PATH'].split(':').collect do |p|
begin remove_trailing_slash(File.expand_path(p)) begin
remove_trailing_slash(File.expand_path(p))
rescue ArgumentError rescue ArgumentError
onoe "The following PATH component is invalid: #{p}" onoe "The following PATH component is invalid: #{p}"
end end
...@@ -439,7 +440,8 @@ def check_user_path_1 ...@@ -439,7 +440,8 @@ def check_user_path_1
out = nil out = nil
path_folders.each do |p| case p paths.each do |p|
case p
when '/usr/bin' when '/usr/bin'
seen_usr_bin = true seen_usr_bin = true
unless $seen_prefix_bin unless $seen_prefix_bin
...@@ -582,7 +584,7 @@ def check_for_config_scripts ...@@ -582,7 +584,7 @@ def check_for_config_scripts
whitelist = %W[/usr/bin /usr/sbin /usr/X11/bin /usr/X11R6/bin /opt/X11/bin #{HOMEBREW_PREFIX}/bin #{HOMEBREW_PREFIX}/sbin] whitelist = %W[/usr/bin /usr/sbin /usr/X11/bin /usr/X11R6/bin /opt/X11/bin #{HOMEBREW_PREFIX}/bin #{HOMEBREW_PREFIX}/sbin]
whitelist.map! { |d| d.downcase } whitelist.map! { |d| d.downcase }
path_folders.each do |p| paths.each do |p|
next if whitelist.include? p.downcase next if whitelist.include? p.downcase
next if p =~ %r[^(#{real_cellar.to_s}|#{HOMEBREW_CELLAR.to_s})] if real_cellar next if p =~ %r[^(#{real_cellar.to_s}|#{HOMEBREW_CELLAR.to_s})] if real_cellar
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment