Skip to content

Commit

Permalink
feat: delete temp file (#677) (#685)
Browse files Browse the repository at this point in the history
  • Loading branch information
n30nx authored Mar 20, 2023
1 parent 621205e commit 328e405
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion terraform_compliance/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import atexit
from argparse import ArgumentParser
from tempfile import mkdtemp
from git import Repo
Expand Down Expand Up @@ -33,8 +34,14 @@ class ArgHandling(object):
pass


def cleanup():
os.remove(Defaults().cache_file)


def cli(arghandling=ArgHandling(), argparser=ArgumentParser(prog=__app_name__,
description='BDD Test Framework for Hashicorp terraform')):
atexit.register(cleanup)

args = arghandling
parser = argparser
parser.add_argument('--terraform', '-t', dest='terraform_file', metavar='terraform_file', type=str, nargs='?',
Expand Down Expand Up @@ -151,4 +158,4 @@ def cli(arghandling=ArgHandling(), argparser=ArgumentParser(prog=__app_name__,


if __name__ == '__main__':
cli()
cli()

0 comments on commit 328e405

Please sign in to comment.