Skip to content

Commit ba88bd5

Browse files
committed
Reapply "Print done"
This reverts commit f846eff.
1 parent f846eff commit ba88bd5

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

cgi-bin/webhook.cgi

+4-6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ require 'cgi'
66
require 'json'
77
require 'logger'
88
require 'openssl'
9+
require 'shellwords'
910

1011
class Webhook
1112
LOG_PATH = '/tmp/webhook.log'
@@ -184,13 +185,10 @@ class PushHook
184185
end
185186

186187
def execute(*cmd, user:)
187-
require 'open3'
188188
cmd = ['/usr/bin/sudo', '-u', user, *cmd]
189-
logger.info("+ #{cmd.join(' ')}")
190-
stdout, stderr, status = Open3.capture3(*cmd)
191-
logger.info("success: #{status.success?}")
192-
logger.info("stdout: #{stdout}")
193-
logger.info("stderr: #{stderr}")
189+
logger.info("+ #{cmd.shelljoin}")
190+
system("#{cmd.shelljoin} > #{Webhook::LOG_PATH} 2>&1")
191+
logger.info("done")
194192
end
195193
end
196194

0 commit comments

Comments
 (0)