Skip to content

Commit f2838ed

Browse files
Merge pull request #490 from gbavieira/main
Adding subfolder creation
2 parents aac13aa + b7c5daa commit f2838ed

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

py/text_files.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ def get_file(root_dir, file):
6868
os.mkdir(root_dir)
6969
full_path = os.path.join(root_dir, file)
7070

71+
file_dir = os.path.dirname(full_path)
72+
if file_dir and not os.path.exists(file_dir):
73+
os.makedirs(file_dir, exist_ok=True)
74+
7175
if not is_child_dir(root_dir, full_path):
7276
raise ReferenceError()
7377

0 commit comments

Comments
 (0)