From bb5c609cc07e6a7f3d876fec0f7ca5de590ac447 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Wed, 2 Aug 2017 20:14:11 -0400 Subject: Cleanups of multimail plugin Richard spotted a --stdout and I wanted to clean up some of the logging. All good now. --- plugins/git-multimail.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'plugins') diff --git a/plugins/git-multimail.lua b/plugins/git-multimail.lua index 23100b6..b1796bf 100644 --- a/plugins/git-multimail.lua +++ b/plugins/git-multimail.lua @@ -66,15 +66,15 @@ local function run_multimail(confbits, env, stdin) stdin = sp.PIPE, stdout = sp.PIPE, stderr = sp.PIPE, - git_multimail_py, "--stdout" + git_multimail_py, } for k, v in pairs(confbits) do args[#args+1] = "-c" args[#args+1] = "multimailhook." .. k .. "=" .. v end - gitano.log.state("About to spawn git_multimail.py as...") + gitano.log.ddebug("About to spawn git_multimail.py as...") for _, v in ipairs(args) do - gitano.log.state("=> " .. v) + gitano.log.ddebug("=> " .. v) end local proc = sp.spawn_simple(args) proc.stdin:write(stdin) @@ -89,13 +89,15 @@ local function run_multimail(confbits, env, stdin) gitano.log.state(pfx .. ": " .. line) end end - gitano.log.state("Git Multimail says:") - show(outcontent, "O") - show(errcontent, "E") + if outcontent ~= "" or errcontent ~= "" then + gitano.log.state("Git Multimail says:") + show(outcontent, "O") + show(errcontent, "E") + end if (how ~= "exit") or (why ~= 0) then gitano.log.error("git_multimail.py failed: " .. tostring(how) .. " " .. tostring(why)) end - gitano.log.state("Done with multimail") + gitano.log.ddebug("Done with multimail") end local function git_multimail_post_receive_hook(repo, updates) -- cgit v1.2.1