lib/minke/helpers/shell.rb in minke-1.13.7 vs lib/minke/helpers/shell.rb in minke-1.13.8

- old
+ new

@@ -5,20 +5,20 @@ @logger = logger end ## # Executes a shell command and returns the return status - def execute command + def execute command, ignore_error=false @logger.debug command Open3.popen2e(command) do |stdin, stdout_err, wait_thr| while line = stdout_err.gets @logger.debug line end exit_status = wait_thr.value - unless exit_status.success? + unless exit_status.success? || ignore_error == true raise "Error executing command: #{command}" end end end @@ -46,6 +46,6 @@ def exist? filename File.exist? filename end end end -end \ No newline at end of file +end