class ChefCLI::Command::GeneratorCommands::Base
def have_git?
Checks the `PATH` for the presence of a `git` (or `git.exe`, on
def have_git? path = ENV["PATH"] || "" paths = path.split(File::PATH_SEPARATOR) exts = [RbConfig::CONFIG["EXEEXT"]] exts.concat(ENV["PATHEXT"].split(";")) unless ENV["PATHEXT"].nil? paths.any? do |bin_path| exts.any? do |ext| File.exist?(File.join(bin_path, "git#{ext}")) end end end