diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2017-08-02 20:14:11 -0400 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2017-08-02 20:14:11 -0400 |
commit | bb5c609cc07e6a7f3d876fec0f7ca5de590ac447 (patch) | |
tree | a4e41ca7e63dcf9a6902a7f29edecc8147f15a87 | |
parent | deb68d518087db6cd6902f9f12df76e67ab5d361 (diff) | |
download | gitano-bb5c609cc07e6a7f3d876fec0f7ca5de590ac447.tar.gz |
Cleanups of multimail plugin
Richard spotted a --stdout and I wanted to clean up
some of the logging. All good now.
-rw-r--r-- | plugins/git-multimail.lua | 16 |
1 files changed, 9 insertions, 7 deletions
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) |