Class: Chef::Knife::HelperExec

Inherits:
Chef::Knife show all
Defined in:
lib/chef/knife/helper_exec.rb

Instance Method Summary collapse

Instance Method Details

#runObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/chef/knife/helper_exec.rb', line 24

def run
  conf = ::Knife::Helper::Config.new(config[:file])
  commands = ::Knife::Helper::Commands.new(
    conf.settings['command_base'],
    conf.commands,
    conf.option_sets
  )
  @name_args.each do |cmd|
    if config[:print_command]
      output commands.build(cmd)
    else
      commands.exec(cmd)
    end
  end
end