Let File.expand_path also do the join
This commit is contained in:
parent
7bd4f76b8c
commit
6e60b1d8c3
@ -184,7 +184,7 @@ end
|
||||
|
||||
def which cmd, path=ENV['PATH']
|
||||
path.split(File::PATH_SEPARATOR).each do |p|
|
||||
pcmd = File.expand_path(File.join(p, cmd))
|
||||
pcmd = File.expand_path(cmd, p)
|
||||
return Pathname.new(pcmd) if File.file?(pcmd) && File.executable?(pcmd)
|
||||
end
|
||||
return nil
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user