2
0
mirror of https://github.com/frappe/bench.git synced 2024-06-27 11:43:29 +00:00

fix: Always set return code via cli

This commit is contained in:
Gavin D'souza 2021-09-09 13:20:26 +05:30
parent a94ea19bf4
commit 552b935f6b

View File

@ -69,6 +69,13 @@ def cli():
return_code = getattr(e, "code", 0)
if return_code:
logger.warning(f"{command} executed with exit code {return_code}")
if isinstance(e, Exception):
raise e
finally:
try:
return_code
except NameError:
return_code = 0
sys.exit(return_code)