Conversation
tylerdave
commented
Apr 5, 2026
- adds incremental builds
- overwrite by default
- clear contents w/ flag
|
Docs Site preview: https://45bcea96.rockgarden.pages.dev |
|
|
||
| if incremental and manifest: | ||
| current_slugs = {p.slug for p in pages} | ||
| for old_slug, entry in list(manifest.pages.items()): |
There was a problem hiding this comment.
Bug: stale output not cleaned up when a page is deleted. When needs_full_rebuild returns True (e.g. page count drops because a page was deleted), the old manifest is discarded and replaced with a fresh empty one. During the build loop all current pages are written into manifest.pages, so by the time stale cleanup runs at line 881, manifest.pages only contains current slugs — old_slug not in current_slugs is never true and the deleted page's HTML file is never removed. test_removed_page_triggers_full_rebuild only asserts skipped_count == 0, not that the orphaned file is gone. Fix: save the loaded old manifest before replacing it, then use its pages dict as the source for stale cleanup regardless of whether a full or incremental rebuild ran.
| shutil.rmtree(output_dir) | ||
| else: | ||
| raise typer.Exit(0) | ||
| if clean and _output_dir_has_contents(output_dir): |
There was a problem hiding this comment.
Previously flagged and still present: interactive confirmation prompt removed. The prior review noted that the typer.confirm("Output directory … exists. Delete contents?") guard was dropped entirely, so a plain rockgarden build into an existing output dir now silently overwrites in place. The docs now document this behaviour, but losing the prompt is still a regression — users who accidentally target the wrong directory get no warning before their previous output is partially overwritten. Consider restoring the prompt for the non---incremental, non---clean path, or at minimum emitting a one-line notice when writing into a non-empty output dir.