Add: import from subfolders

This commit is contained in:
Aroy-Art 2023-08-27 16:24:55 +02:00
parent 90a6b3d32b
commit 0072b8dfbd
Signed by: Aroy
GPG key ID: 583642324A1D2070

View file

@ -53,9 +53,10 @@ class Command(BaseCommand):
tqdm.write(self.style.ERROR(f"The folder '{folder_path}' does not exist."))
return
for file_name in tqdm(os.listdir(folder_path), dynamic_ncols=True):
for root, dirs, files in tqdm(os.walk(folder_path), dynamic_ncols=True):
for file_name in files:
if file_name.endswith('.json'):
file_path = os.path.join(folder_path, file_name)
file_path = os.path.join(root, file_name)
self.process_json_file(file_path)