From c227792bc16c930d637ef3a255b1848cf8eb9aa6 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Thu, 6 Sep 2012 10:38:58 -0500 Subject: 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: Jack Nagel --- Library/Homebrew/global.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library') diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index d321f1c25..6075f0cd2 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -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 -- cgit v1.2.3