Skip to content

Commit d7e7fa3

Browse files
authored
Return system exit code when running as module (#729)
1 parent b691090 commit d7e7fa3

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

terraform_compliance/__main__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import sys
2+
13
from .main import cli
24

3-
cli()
5+
sys.exit(cli())

terraform_compliance/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
import os
23
import shutil
34
import atexit
@@ -159,4 +160,4 @@ def cli(arghandling=ArgHandling(), argparser=ArgumentParser(prog=__app_name__,
159160

160161

161162
if __name__ == '__main__':
162-
cli()
163+
sys.exit(cli())

0 commit comments

Comments
 (0)