Skip to content

Commit

Permalink
Add asserts to make sure wiki is always updated
Browse files Browse the repository at this point in the history
  • Loading branch information
mathbunnyru committed Nov 7, 2023
1 parent 7166835 commit 4915006
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tagging/update_wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -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)
Expand Down

0 comments on commit 4915006

Please sign in to comment.