Keep cast --check from creating the bundle dir#366
Merged
Conversation
runCastMoldCommand mkdir'd bundleRoot before branching on --check, so a drift check against a never-cast Mold left an empty casts/claude/skills/<mold>/ behind. Git ignores empty dirs, so these were invisible in git status but broke plugin-packaging's SKILL.md-per-skill assertion. All other writes in the check path were already guarded; only the mkdir was not. Closes #360 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Closes #360.
runCastMoldCommandcalledmkdirSync(bundleRoot, { recursive: true })before anything branched onargs.check, so a read-only drift check against a never-cast Mold left an emptycasts/claude/skills/<mold>/behind. Git doesn't track empty dirs, so these were invisible ingit statusbut broketests/plugin-packaging.test.ts's SKILL.md-per-skill assertion.Every other write in the check path (
castOneRef,reconcileSkillMarkdown,_required_tools.json,_verify.json) was already guarded — the mkdir was the sole leak.Regression test
tests/cast-mold.test.ts— "--checkon a never-cast mold leaves no bundle directory behind": temp repo, minimal Mold with no refs,cast m --check→ nonzero exit,SKILL.mddrift reported,casts/claude/skills/mabsent. Confirmed red-to-green.Verification
cast validate-cwl --checkreports both drifts, exit 1, no dir created.--checkscan over allcontent/molds/*/index.md:find casts/claude/skills -type d -emptyreturns nothing.npm run test151/151,typecheck0 errors,packages-test,packages-format,packages-lint,validate(0 errors) all pass.🤖 Generated with Claude Code