mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
18 lines
366 B
Ruby
18 lines
366 B
Ruby
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
|
|
|
|
def pretty_logs(logs)
|
|
logs.join("\n")
|
|
end
|
|
end
|
|
end
|