From b7c5daa933d82fcd1cedc5a236fbf1ca06394eb4 Mon Sep 17 00:00:00 2001 From: gbavieira Date: Tue, 29 Jul 2025 11:27:55 -0300 Subject: [PATCH] Adding subfolder creation --- py/text_files.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/py/text_files.py b/py/text_files.py index 253de9b..42de6d7 100644 --- a/py/text_files.py +++ b/py/text_files.py @@ -68,6 +68,10 @@ def get_file(root_dir, file): os.mkdir(root_dir) full_path = os.path.join(root_dir, file) + file_dir = os.path.dirname(full_path) + if file_dir and not os.path.exists(file_dir): + os.makedirs(file_dir, exist_ok=True) + if not is_child_dir(root_dir, full_path): raise ReferenceError()