Skip to content
Snippets Groups Projects
Commit a8d5a666 authored by Manon Blanco's avatar Manon Blanco
Browse files

Create missing folders if needed

parent 8c1ccd28
No related branches found
No related tags found
1 merge request!419Create missing folders if needed
......@@ -18,6 +18,8 @@ def run(database: Path, output_file: Path) -> None:
entities = list(
map(itemgetter(0), EntityType.select(EntityType.name).distinct().tuples())
)
output_file.parent.mkdir(exist_ok=True, parents=True)
output_file.write_text(
yaml.safe_dump({"entities": entities}, explicit_start=True, allow_unicode=True)
)
......@@ -37,6 +37,7 @@ def run(entities: Path, end_tokens: bool, output_file: Path) -> None:
}
# Save entities & tokens to YAML
output_file.parent.mkdir(exist_ok=True, parents=True)
output_file.write_text(
yaml.safe_dump(tokens, explicit_start=True, allow_unicode=True, sort_keys=False)
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment