mkdir parents in update_wiki.py (#2225)

This commit is contained in:
Fabian Rost
2025-02-19 19:07:14 +01:00
committed by GitHub
parent 6fc3bf04ac
commit 332aac5ba7

View File

@@ -111,7 +111,7 @@ def update_monthly_wiki_page(
year = year_month[:4] year = year_month[:4]
monthly_page = wiki_dir / "monthly-files" / year / (year_month + ".md") monthly_page = wiki_dir / "monthly-files" / year / (year_month + ".md")
if not monthly_page.exists(): if not monthly_page.exists():
monthly_page.parent.mkdir(exist_ok=True) monthly_page.parent.mkdir(parents=True, exist_ok=True)
monthly_page.write_text(MONTHLY_PAGE_HEADER) monthly_page.write_text(MONTHLY_PAGE_HEADER)
LOGGER.info(f"Created monthly page: {monthly_page.relative_to(wiki_dir)}") LOGGER.info(f"Created monthly page: {monthly_page.relative_to(wiki_dir)}")