class Imagemaster3000::Utils::CommandExecutioner

Public Class Methods

execute(*args) click to toggle source
# File lib/imagemaster3000/utils/command_executioner.rb, line 7
def execute(*args)
  command = Mixlib::ShellOut.new(*args)
  logger.debug "Executing command: #{command.command.inspect}"
  command.run_command

  if command.error?
    raise Imagemaster3000::Errors::CommandExecutionError, "Command #{command.command.inspect} terminated with an error: " \
                                                      "#{command.stderr}"
  end

  command.stdout
end