Skip to content

Commit

Permalink
adding cleaning of dist folder
Browse files Browse the repository at this point in the history
  • Loading branch information
T0ine34 committed Jul 7, 2024
1 parent ba3984d commit 913b240
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 11 additions & 0 deletions builder-tool/src/builderTool.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,17 @@ def __init__(self):
Logger.debug('Using temporary directory: ' + os.path.abspath(self.args.temp_dir))
Logger.debug('Using distribution directory: ' + os.path.abspath(self.args.dist_dir))

# clear the dist directory
try:
shutil.rmtree(self.args.dist_dir)
except FileNotFoundError:
pass
except Exception as e:
Logger.error('Error while cleaning dist directory: ' + str(e))
sys.exit(1)

os.makedirs(self.args.dist_dir, exist_ok=True)

@property
def tempDir(self):
return os.path.abspath(self.args.temp_dir)
Expand Down
2 changes: 0 additions & 2 deletions create-module/src/createModule.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ def create(self):
if self.step != Step.INITIATED:
raise ValueError("Archive already created")

Logger.info(f"starting creation of archive {self.archiveName}")
self.__checkFolderContent()
self.zipFile = ZipFile(self.archiveName, 'w')
self.__addCode()
self.__createJson()
Logger.info(f"Archive {self.archiveName} created")
self.step = Step.BUILT

def __checkFolderContent(self):
Expand Down

0 comments on commit 913b240

Please sign in to comment.