lib/kite/helpers/concourse.rb in kite-0.2.0 vs lib/kite/helpers/concourse.rb in kite-1.0.0
- old
+ new
@@ -22,11 +22,12 @@
def self.fatal(message)
respond(version: { status: 'error' }, metadata: [message])
exit 1
end
- def self.execute(command, env = {})
- log("+ #{ command }")
+ def self.execute(command, env = {}, gsub_log_args = nil)
+ command_log = gsub_log_args ? command.gsub(*gsub_log_args) : command
+ log("+ #{ command_log }")
Open3.popen2e(env, command) do |stdin, stdout, wait_thr|
::Kite::Helpers::Concourse.log(stdout.read)
return wait_thr.value.exitstatus.zero?
end
end