This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Continue to next file / task when pressing 'n' at clobber prompt#32
Merged
FooSoft merged 2 commits intoFooSoft:masterfrom Dec 14, 2021
Merged
Conversation
The end user would be prompted if a file is going to be overwritten, but homemaker would still attempt to do so no matter the answer. Move the retry-functionality of cleanPath inside this function so that the function itself can return a boolean to indicate if the calling task is free to continue. If the path is not clean then homemaker can just move on to the next file or next task.
Contributor
Author
|
My changes are slightly easier to visualize if you review commit by commit. I started in |
Owner
|
Makes sense, sorry for not seeing this earlier. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
A prompt shows up if Homemaker detects an existing file when creating a link or running a template.
Pressing
nmight stop the problematic file from being removed, but homemaker will still continue:Pressing
cwill obviously mean that nothing has happened, but no such luck for templates:At this point the target file is overwritten.
This PR shuffles the code around so that the
cleanPath()function which shows the "clobber path" prompt can return a boolean, at which point the caller can decide to stop doing what it is doing.