fix(site): delete only an output directory the build made - #90
Merged
Merged
Conversation
build_site.py deleted any --out that was not the repository, site/, or above them, so a typo like --out docs deleted source. It now clears only a missing or empty directory, or one carrying the .plumbline-site marker that every build writes, and refuses the rest before any work is done. Fixes #50. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #50.
scripts/build_site.pydeletes--outbefore it writes the site. Until now the only guard refused the repository root,site/, and the directories above them. Anything else was deleted, so--out docs,--out src,--out .git, or--out ~deleted it.Now every build writes a
.plumbline-sitemarker into its output.refusal_to_clear(out)allows only three kinds of path:Anything else is refused, with a message that says why, before any build work starts. The old repository and
site/check is still there.A contributor's
_sitefrom before this change has no marker, so it is refused once and has to be removed by hand. The CHANGELOG entry says so. CI builds into a fresh checkout, so it is not affected.actions/upload-pages-artifactleaves out dotfiles, so the marker is never deployed.Tests: every protected path is refused (repo root,
site/,docs/,src/,.git/, home, a file, a directory holding a stranger's file). A new directory, an empty one, and one built earlier are accepted. Run by hand: a fresh build, a rebuild over its own output, and--out docs(refused, exit 1).check_site_links.mjspasses on the output.🤖 Generated with Claude Code