Repository navigation
fix(seed): fail on per-file write errors instead of exiting 0 - #725
Merged
dubadub merged 1 commit intoOct 15, 2026
Merged
Conversation
The seed loop mapped each embedded file to its `fs::write` result and dropped the `Result` on the floor, so `cook seed .` reported success while leaving files unwritten — for example when a directory already sat where a seed file belonged. Propagate the error with context so the failed file is named and the command exits nonzero. Closes #707
LeMyst
reviewed
Oct 13, 2026
LeMyst
left a comment
Collaborator
There was a problem hiding this comment.
Looks good to me. The .map() that discarded the io::Result is now a loop with ? on create_dir_all and fs::write, so the repro from #707 (mkdir Risotto.cook; cook seed .) fails and names the file. Optional: that repro would make an easy integration test. Merges cleanly with #724.
🤖 Analysis and recommendations made by Claude (Anthropic's AI assistant), posted on behalf of @LeMyst.
1 task done
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 #707
cook seeddiscarded eachfs::writeresult inside.map(), so a blocked file (e.g. a directory namedRisotto.cook) produced exit 0 with no file and no message. The loop now propagates write/mkdir errors with the file path.Test plan
mkdir Risotto.cook && cook seed .printsError: Failed to write seed file: ./Risotto.cookand exits 1