Skip to content

Commit

Permalink
[Exporter] create folder if it doesnt exist instead of raising an error
Browse files Browse the repository at this point in the history
  • Loading branch information
techfreaque committed Sep 13, 2022
1 parent 0924dda commit 4676fb1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions octobot_tentacles_manager/exporters/artifact_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ async def create_metadata_file(self) -> None:
"""
try:
artifact_metadata: models.ArtifactMetadata = await self.get_metadata_instance()
if not os.path.exists(artifact_metadata.artifact.output_dir):
os.makedirs(artifact_metadata.artifact.output_dir)
async with aiofiles.open(os.path.join(self.get_metadata_file_path(),
constants.ARTIFACT_METADATA_FILE), "w") as metadata_file:
await metadata_file.write(yaml.dump(artifact_metadata.to_dict()))
Expand Down

0 comments on commit 4676fb1

Please sign in to comment.