Add: import from subfolders
This commit is contained in:
parent
90a6b3d32b
commit
0072b8dfbd
1 changed files with 5 additions and 4 deletions
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue