which is supposed to return a pathname

This commit is contained in:
Adam Vandenberg 2014-03-16 16:05:05 -07:00
parent 844e94526e
commit 6a13c9e434

View File

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