Repository navigation
fix(cli): plan and clean refuse a project that is not a folder - #17
Merged
Merged
Conversation
`opensweep plan ~/code/my-stie` (a typo) printed "Idle, no edits or commits found" and "nothing matched", and `clean` printed "Nothing to clean.", both with exit code 0. Given a file, plan even called it Pinned because "its .opensweep.toml cannot be read". Now both commands stop with "<path> is not a folder" and exit 1, in text and JSON. The check sits in `absolute`, which both commands already route every project path through. The app is not affected: it always passes --only with the folders it picked, and a missing --only folder already fails the command.
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.
What
planandcleannow stop with<path> is not a folderand exit 1 when a project path is missing or is a file, in text and--jsonmode ({"error": "...", "schema_version": 1}). Before, they reported the path as an idle project with nothing to clean and exited 0.The check is in
absolute(), which both commands already route every project path through, so there is one guard and no new helper.The app is not affected:
AppModel.cleanalways passes--onlywith the folders it picked, and a missing--onlyfolder already fails the command.Closes #16
How tested
a_project_that_is_not_a_folder_is_an_error:planandcleanon a missing path and on a file. It fails onmainand passes with the fix.cargo test --locked149 passed (148 onmainplus the new one), rules-check 12 rule files, 34 artifacts: ok.