Skip to content

Commit 7e4e184

Browse files
committed
Create all necessary directories during wiki update
1 parent a6ef176 commit 7e4e184

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tagging/update_wiki.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def update_monthly_wiki_page(
111111
year = year_month[:4]
112112
monthly_page = wiki_dir / "monthly-files" / year / (year_month + ".md")
113113
if not monthly_page.exists():
114+
monthly_page.parent.mkdir(exist_ok=True)
114115
monthly_page.write_text(MONTHLY_PAGE_HEADER)
115116
LOGGER.info(f"Created monthly page: {monthly_page.relative_to(wiki_dir)}")
116117

@@ -165,7 +166,7 @@ def update_wiki(
165166
year_month = get_manifest_year_month(manifest_file)
166167
year = year_month[:4]
167168
copy_to = wiki_dir / "manifests" / year / year_month / manifest_file.name
168-
copy_to.parent.mkdir(exist_ok=True)
169+
copy_to.parent.mkdir(parents=True, exist_ok=True)
169170
shutil.copy(manifest_file, copy_to)
170171
LOGGER.info(f"Added manifest file: {copy_to.relative_to(wiki_dir)}")
171172

0 commit comments

Comments
 (0)