diff --git a/osbuild/__main__.py b/osbuild/__main__.py index 7d0c70f4..f5275b01 100755 --- a/osbuild/__main__.py +++ b/osbuild/__main__.py @@ -4,9 +4,11 @@ This specifies the entrypoint of the osbuild module when run as executable. For compatibility we will continue to run the CLI. """ +import sys from osbuild.main_cli import osbuild_cli as main if __name__ == "__main__": - main() + r = main() + sys.exit(r) diff --git a/osbuild/main_cli.py b/osbuild/main_cli.py index dba0d45b..acd19d72 100644 --- a/osbuild/main_cli.py +++ b/osbuild/main_cli.py @@ -172,4 +172,4 @@ def osbuild_cli(): print() print(f"{RESET}{BOLD}{RED}Failed{RESET}") - sys.exit(0 if r["success"] else 1) + return 0 if r["success"] else 1