mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-08 10:34:06 +00:00
Add asserts to make sure wiki is always updated
This commit is contained in:
@@ -18,6 +18,7 @@ def update_home_wiki_page(wiki_dir: Path, month: str) -> None:
|
||||
wiki_home_content = wiki_home_file.read_text()
|
||||
month_line = f"| [`{month}`](./{month}) |\n"
|
||||
if month_line not in wiki_home_content:
|
||||
assert TABLE_BEGINNING in wiki_home_content
|
||||
wiki_home_content = wiki_home_content.replace(
|
||||
TABLE_BEGINNING, TABLE_BEGINNING + month_line
|
||||
)
|
||||
@@ -39,7 +40,9 @@ def update_monthly_wiki_page(
|
||||
monthly_page.write_text(MONTHLY_PAGE_HEADER)
|
||||
LOGGER.info(f"Created monthly page: {monthly_page.relative_to(wiki_dir)}")
|
||||
|
||||
monthly_page_content = monthly_page.read_text().replace(
|
||||
monthly_page_content = monthly_page.read_text()
|
||||
assert MONTHLY_PAGE_HEADER in monthly_page_content
|
||||
monthly_page_content = monthly_page_content.replace(
|
||||
MONTHLY_PAGE_HEADER, MONTHLY_PAGE_HEADER + build_history_line + "\n"
|
||||
)
|
||||
monthly_page.write_text(monthly_page_content)
|
||||
|
Reference in New Issue
Block a user