Start setting up conversion workflow

This commit is contained in:
James Grogan 2024-09-29 20:28:44 +01:00
parent 8974849b8b
commit 00325b36eb
4 changed files with 46 additions and 36 deletions

View file

@ -1,5 +1,20 @@
from pathlib import Path
import os
import sys
def get_files_recursive(search_path: Path, extension: str) -> list[Path]:
return list(search_path.rglob(f"*.{extension}"))
def delete_empty_dirs_recursive(search_path: Path):
for curdir, subdirs, files in os.walk(search_path):
if len(subdirs) == 0 and len(files) == 0:
#print(curdir)
os.rmdir(curdir)
if __name__ == "__main__":
input_path = sys.argv[1]
print(input_path)
delete_empty_dirs_recursive(Path(input_path).resolve())