Skip to content

Commit 20f5679

Browse files
committed
fix: minor fix in c_postprocess_html.py to avoid deleting old versions of the docs
1 parent 8f7d6a7 commit 20f5679

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

_tools/c_postprocess_html.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ def main():
6969
if not doc_dir.exists():
7070
fail(f"Build the HTML docs first; {doc_dir} does not exist")
7171

72-
if jekyll_dir.exists():
73-
rmtree(jekyll_dir)
74-
7572
for version in versions:
7673
doc_dir_version = doc_dir / version
7774
jekyll_dir_version = jekyll_dir / version
@@ -83,6 +80,9 @@ def main():
8380
continue
8481

8582
print(jekyll_dir_version)
83+
if jekyll_dir_version.exists():
84+
rmtree(jekyll_dir_version)
85+
8686
jekyll_dir_version.mkdir(parents=True, exist_ok=True)
8787
for html_file in doc_dir_version.glob("*.html"):
8888
jekyll_html_file = jekyll_dir_version / html_file.name

0 commit comments

Comments
 (0)