mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 00:23:43 +08:00
15 lines
309 B
Ruby
15 lines
309 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
|
||
|
end
|
||
|
end
|