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 | |
parent | a3670131b2ffcdfabec65d61fee04b64cdca49b2 (diff) | |
download | gitano-1eb072ad68d52821deda1402573125f340b8cc8d.tar.gz |
Honour suppression of error messages from running comands
-rw-r--r-- | bin/gitano-auth.in | 6 | ||||
-rw-r--r-- | lib/gitano/util.lua | 12 |
2 files changed, 11 insertions, 7 deletions
diff --git a/bin/gitano-auth.in b/bin/gitano-auth.in index b8a5cdc..d82f941 100644 --- a/bin/gitano-auth.in +++ b/bin/gitano-auth.in @@ -40,11 +40,13 @@ local authorized, cmd, parsed_cmdline, config, env, repo = transactionid, start_log_level, keytag) if authorized then - local exit = gitano.util.run_command(cmd, cmdline, parsed_cmdline, + local exit, quiet = gitano.util.run_command(cmd, cmdline, parsed_cmdline, user, config, env, repo) if exit ~= 0 then - gitano.log.critical(gitano.i18n.expand("ERROR_COMMAND_FAILED")) + if not quiet then + gitano.log.critical(gitano.i18n.expand("ERROR_COMMAND_FAILED")) + end luxio._exit(exit) end else 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 |