diff --git a/src/files.py b/src/files.py index 59b4639..83971e8 100644 --- a/src/files.py +++ b/src/files.py @@ -97,7 +97,8 @@ class DocumentTree(): def document_write(self, path: str, text: str) -> None: internal_path = os.path.join(self.base, *path.split('/')) + '.md' - # TODO: Check if the directory exists before writing + # TODO: Probably add some sort of confirmation beforehand? + os.makedirs(os.path.dirname(internal_path)) with open(internal_path, 'w') as file: file.write(text)