2016-07-21 22:45:39 -04:00
|
|
|
module BackupRestore
|
|
|
|
module Utils
|
|
|
|
def execute_command(command, failure_message = "")
|
|
|
|
output = `#{command} 2>&1`
|
|
|
|
|
|
|
|
if !$?.success?
|
|
|
|
failure_message = "#{failure_message}\n" if !failure_message.blank?
|
|
|
|
raise "#{failure_message}#{output}"
|
|
|
|
end
|
|
|
|
|
|
|
|
output
|
|
|
|
end
|
2016-08-03 04:18:35 -04:00
|
|
|
|
|
|
|
def pretty_logs(logs)
|
|
|
|
logs.join("\n")
|
|
|
|
end
|
2016-07-21 22:45:39 -04:00
|
|
|
end
|
|
|
|
end
|