Skip to content

Commit 1439cad

Browse files
committed
Simplify create_index_file
1 parent 5f06b74 commit 1439cad

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

build.py

+5-8
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,11 @@ def create_parser():
2323
return parser.parse_args()
2424

2525

26-
def create_index_file(html_content: Path):
27-
pep_zero_html = html_content / "pep-0000.html"
28-
pep_zero_dir = html_content / "pep-0000" / "index.html"
29-
30-
if pep_zero_html.is_file():
31-
shutil.copy(pep_zero_html, html_content / "index.html")
32-
elif pep_zero_dir.is_file():
33-
shutil.copy(pep_zero_dir, html_content / "index.html")
26+
def create_index_file(html_root: Path):
27+
"""Copies PEP 0 to the root index.html so that /peps/ works."""
28+
pep_zero_path = html_root / "pep-0000" / "index.html"
29+
if pep_zero_path.is_file():
30+
shutil.copy(pep_zero_path, html_root / "index.html")
3431

3532

3633
if __name__ == "__main__":

0 commit comments

Comments
 (0)