Skip to content

Commit bf084cb

Browse files
committed
create output folder and index.html
1 parent e03949b commit bf084cb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

replace_index_with_redirect.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import os
55
import os.path as osp
6-
import shutil
76

87
publications_text = """
98
<!DOCTYPE html>
@@ -18,6 +17,7 @@
1817
</html>
1918
"""
2019

21-
if osp.isfile("output/index.html"):
22-
with open("output/index.html", "w") as file_handle:
23-
file_handle.write(publications_text)
20+
# Ensure output/ exists, then write the redirect index.html
21+
os.makedirs("output", exist_ok=True)
22+
with open("output/index.html", "w") as file_handle:
23+
file_handle.write(publications_text)

0 commit comments

Comments
 (0)