diff --git a/clean_translations.py b/clean_translations.py index a0d2893e448..814d63fdd61 100644 --- a/clean_translations.py +++ b/clean_translations.py @@ -4,13 +4,16 @@ files_in_main = [] -for i in os.listdir("_pages/en_US/"): - files_in_main.append(i) +for i in os.listdir("docs"): + if i.endswith(".md"): + files_in_main.append(i) -for i in os.listdir("_pages/"): - if i == "en_US": +for i in os.listdir("docs"): + if not os.path.isdir(f"docs/{i}"): continue - for j in os.listdir(f"_pages/{i}"): + if i in [".vitepress", "public", "_include"]: + continue + for j in os.listdir(f"docs/{i}"): if j not in files_in_main: - print(f"Deleting _pages/{i}/{j}") - os.remove(f"_pages/{i}/{j}") + print(f"Deleting docs/{i}/{j}") + os.remove(f"docs/{i}/{j}")