Skip to content

Commit

Permalink
clean_translations: update for VitePress
Browse files Browse the repository at this point in the history
  • Loading branch information
lifehackerhansol committed Sep 28, 2024
1 parent 1cf4a4d commit 730e1e7
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions clean_translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

0 comments on commit 730e1e7

Please sign in to comment.