Class: PackRb::SubCommands

Inherits:
Object
  • Object
show all
Includes:
Build, Inspect, Validate
Defined in:
lib/pack_rb/sub_commands.rb,
lib/pack_rb/sub_commands/build.rb,
lib/pack_rb/sub_commands/inspect.rb,
lib/pack_rb/sub_commands/validate.rb,
lib/pack_rb/sub_commands/error/errors.rb

Defined Under Namespace

Modules: Build, Error, Inspect, Validate

Instance Method Summary collapse

Methods included from Validate

#validate

Methods included from Inspect

#inspect_tpl

Methods included from Build

#build, #parse_options

Instance Method Details

#execute(opts) ⇒ Array

Execute a Packer command via Executor.run_cmd_stream_output

Parameters:

  • opts (Hash)

    options passed to the Packer class

Returns:

  • (Array)
    • stdout [String], stderr [String], exit code [Fixnum]



17
18
19
20
21
22
# File 'lib/pack_rb/sub_commands.rb', line 17

def execute(opts)
  cmd = opts[:cmd]
  tpl = opts[:tpl]

  PackRb::Executor.run_cmd_stream_output("#{cmd} -", tpl)
end