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

Don't raise when expanding ORIGINAL_PATHS


File.expand_path raises ArgumentError when it is passed a path with a
nonexistent username, e.g.:

  $ PATH=~foo/bin:$PATH brew
  /usr/local/Library/Homebrew/global.rb:97:in `expand_path': user foo
  doesn't exist (ArgumentError)

However, `brew doctor` does its own expansion of PATH entries and
outputs warnings if this happens, so let's just ignore it here and
continue on our way.

Signed-off-by: default avatarJack Nagel <jacknagel@gmail.com>
parent b20c35cf
No related branches found
No related tags found
No related merge requests found
......@@ -94,4 +94,4 @@ unless ARGV.include? "--no-compat" or ENV['HOMEBREW_NO_COMPAT']
require 'compatibility'
end
ORIGINAL_PATHS = ENV['PATH'].split(':').map{ |p| Pathname.new(File.expand_path(p)) }
ORIGINAL_PATHS = ENV['PATH'].split(':').map{ |p| Pathname.new(File.expand_path(p)) rescue nil }.compact.freeze
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