which is supposed to return a pathname
This commit is contained in:
		
							parent
							
								
									844e94526e
								
							
						
					
					
						commit
						6a13c9e434
					
				@ -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
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user