20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/subshell.rb', line 20
def exec(command, options = {})
options = @default_options.merge(options)
output, exit_status = run_command(command, options)
if exit_status == options[:expected_status]
log_debug options, "Subshell.exec \"#{command}\" succeeded with output:\n#{output}"
output
else
error = "Subshell.exec #{command} failed with status #{exit_status} (expected #{options[:expected_status]}):\n#{output}"
log_error options, error
fail error
end
end
|