Sha256: d47f4945ff3c0b35e420b59a5b6520a109bf3d076a6df2ebaabab91677ed051c
Contents?: true
Size: 422 Bytes
Versions: 212
Compression:
Stored size: 422 Bytes
Contents
module Kontena module Machine module Common def which(cmd) exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : [''] ENV['PATH'].split(File::PATH_SEPARATOR).each do |path| exts.each { |ext| exe = File.join(path, "#{cmd}#{ext}") return exe if File.executable?(exe) && !File.directory?(exe) } end return nil end end end end
Version data entries
212 entries across 212 versions & 2 rubygems