Sha256: 4c66a64591518420db8ee2534d0bb97e2b041b810fd3eb9c64638d850dbd2749
Contents?: true
Size: 618 Bytes
Versions: 20
Compression:
Stored size: 618 Bytes
Contents
Facter.add("staging_http_get") do setcode do fact = nil which = lambda do |cmd| result = nil exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : [''] ENV['PATH'].split(File::PATH_SEPARATOR).each do |path| exts.each do |ext| exe = File.join(path, "#{cmd}#{ext}") result = exe if File.executable? exe break if result end break if result end result end ['powershell', 'curl', 'wget'].each do |cmd| available = which.call(cmd) fact = available ? cmd : nil break if fact end fact end end
Version data entries
20 entries across 20 versions & 1 rubygems