Module: ShellOut

Included in:
ServerTools::CLI
Defined in:
lib/server_tools/support/shell_out.rb

Instance Method Summary collapse

Instance Method Details

#shell_out(cmd, options: {}) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/server_tools/support/shell_out.rb', line 5

def shell_out(cmd, options: {})
  opts = options.merge(live_stdout: STDOUT, live_stderr: STDERR)
  shellout = Mixlib::ShellOut.new(cmd, opts)
  puts cmd
  Bundler.with_clean_env do
    shellout.run_command
  end
  handle_errors(shellout)
end