mirror of
https://github.com/Escartem/AnimeWwise.git
synced 2026-07-01 01:30:26 +08:00
don't create folder if empty
This commit is contained in:
@@ -252,7 +252,9 @@ def main():
|
||||
|
||||
# prepare folders
|
||||
os.makedirs(path(f"output/{filename}"), exist_ok=True)
|
||||
if len(new_files) > 0:
|
||||
os.makedirs(path("temp/new_files"), exist_ok=True)
|
||||
if len(changed_files) > 0:
|
||||
os.makedirs(path("temp/changed_files"), exist_ok=True)
|
||||
|
||||
# split files into corresponding folder
|
||||
@@ -264,7 +266,9 @@ def main():
|
||||
|
||||
# move them to output
|
||||
final_path = f"output/{filename}"
|
||||
if len(new_files) > 0:
|
||||
shutil.move("temp/new_files", f"{final_path}/new_files")
|
||||
if len(changed_files) > 0:
|
||||
shutil.move("temp/changed_files", f"{final_path}/changed_files")
|
||||
|
||||
# cleanup
|
||||
|
||||
Reference in New Issue
Block a user