Just use each since we're returning from inside the block
This commit is contained in:
parent
c7ac8ce454
commit
7e268670ed
@ -183,7 +183,7 @@ def puts_columns items, star_items=[]
|
||||
end
|
||||
|
||||
def which cmd, path=ENV['PATH']
|
||||
path.split(File::PATH_SEPARATOR).find do |p|
|
||||
path.split(File::PATH_SEPARATOR).each do |p|
|
||||
pcmd = File.expand_path(File.join(p, cmd))
|
||||
return Pathname.new(pcmd) if File.executable?(pcmd) && !File.directory?(pcmd)
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user