Skip to content

Commit

Permalink
fix removal of non-existing directory
Browse files Browse the repository at this point in the history
  • Loading branch information
olinux committed Sep 25, 2023
1 parent 619eeed commit 07a7147
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion openMINDS_pipeline/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ def qualify_property_names(schemas:List[SchemaStructure]):

def copy_to_target_directory(directory_structure: DirectoryStructure, version:str):
schemas_version_directory = os.path.join(directory_structure.target_directory, "schemas", version)
shutil.rmtree(schemas_version_directory)
if os.path.exists(schemas_version_directory):
shutil.rmtree(schemas_version_directory)
shutil.copytree(directory_structure.expanded_directory, schemas_version_directory)
for root, dirs, files in os.walk(schemas_version_directory):
for file_name in files:
Expand Down

0 comments on commit 07a7147

Please sign in to comment.