Expand ~ in PATH entries

This commit is contained in:
Jack Nagel 2014-07-06 11:15:14 -05:00
parent 32d8574d8c
commit c7ac8ce454

View File

@ -184,7 +184,7 @@ end
def which cmd, path=ENV['PATH']
path.split(File::PATH_SEPARATOR).find do |p|
pcmd = File.join(p, cmd)
pcmd = File.expand_path(File.join(p, cmd))
return Pathname.new(pcmd) if File.executable?(pcmd) && !File.directory?(pcmd)
end
return nil