Skip to content

Commit 79c5498

Browse files
authored
Add missing directory creation when writing to file (#33)
1 parent d991b15 commit 79c5498

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/utils/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ def write_to_file(
115115
output_file: Path | str,
116116
data: dict[str, EuroPythonSession] | dict[str, EuroPythonSpeaker],
117117
) -> None:
118+
Path(output_file).parent.absolute().mkdir(parents=True, exist_ok=True)
119+
118120
with open(output_file, "w") as fd:
119121
json.dump(
120122
{k: json.loads(v.model_dump_json()) for k, v in data.items()},

0 commit comments

Comments
 (0)