diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2016-12-13 13:12:16 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2016-12-13 13:12:16 +0000 |
commit | 1eb072ad68d52821deda1402573125f340b8cc8d (patch) | |
tree | 0be45d1420c573123ab1941f456122fff19db699 /lib | |
parent | a3670131b2ffcdfabec65d61fee04b64cdca49b2 (diff) | |
download | gitano-1eb072ad68d52821deda1402573125f340b8cc8d.tar.gz |
Honour suppression of error messages from running comands
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitano/util.lua | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/gitano/util.lua b/lib/gitano/util.lua index 8bcbfd1..f2dd391 100644 --- a/lib/gitano/util.lua +++ b/lib/gitano/util.lua @@ -29,14 +29,16 @@ local function run_command(cmd, cmdline, parsed_cmdline, user, local how, why = cmd.run(config, repo, parsed_cmdline, env) if how ~= "exit" or why ~= 0 then - log.critical(i18n.expand("ERROR_RUNNING_COMMAND", - {cmd=parsed_cmdline[1], reason=how, code=why})) - log.critical(i18n.expand("UNABLE_TO_CONTINUE")) - return why + if not cmd.suppress_error_msgs then + log.critical(i18n.expand("ERROR_RUNNING_COMMAND", + {cmd=parsed_cmdline[1], reason=how, code=why})) + log.critical(i18n.expand("UNABLE_TO_CONTINUE")) + end + return why, cmd.suppress_error_msgs else log.syslog.info(i18n.expand("MSG_COMPLETED_SUCCESSFULLY", {cmd=cmdline})) - return 0 + return 0, false end end |