Sha256: ac379de2e72c5caf09fc5bf527878646d00c0016e4bf45773814cfb1d57a1251
Contents?: true
Size: 1.1 KB
Versions: 17
Compression:
Stored size: 1.1 KB
Contents
#!/usr/bin/env ruby require 'rubygems' require 'safe_yaml' SafeYAML::OPTIONS[:default_mode] = :safe # Borrowing from "whiches" gem ... cmd = 'knife' exes = [] exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : [''] ENV['PATH'].split(File::PATH_SEPARATOR).each do |path| exts.each { |ext| exe = File.join(path, "#{cmd}#{ext}") exes << exe if File.executable? exe } end path = if exes.size > 0 File.dirname(exes[0]) else File.dirname(__FILE__) end $:.unshift(File.expand_path(File.join(path, "..", "lib"))) require 'chef/application/knife' require 'chef/knife/bootstrap' # If it is translate,upload we will let the uploader do the heavy lifting verb = 'upload' me = 'chop' # File.basename(__FILE__) act = false ARGV.each{|w| if w.match(%r(^--action$)) act = true else case w when 'upload' verb = w when 'translate' verb = w else if act aw = w.split(%r([:,])) verb = aw[0] if aw end end end } ARGV.unshift verb unless ARGV[0] == verb ARGV.unshift me Chef::Application::Knife.new.run
Version data entries
17 entries across 17 versions & 1 rubygems