PR from Fecony's contribution to ask for removing files#617
Merged
davidverdu merged 25 commits intomainfrom Feb 19, 2021
Merged
PR from Fecony's contribution to ask for removing files#617davidverdu merged 25 commits intomainfrom
davidverdu merged 25 commits intomainfrom
Conversation
…o feat/overriding_files
[WIP] feat(cli): ask to override files
juanjoman
approved these changes
Feb 19, 2021
adriangmweb
approved these changes
Feb 19, 2021
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.
PR created on behalf of @fecony and related to this external PR #475
Check if project folder or resource already exist before generating new file. It will ask user if he wants to override existing file and continue or stop generating. If user agrees to override it file/project folder is removed. If declines then it will throw error for user to use different resource name. (See Images below)
Closes #305
Changes
projectDir()checkProjectAlreadyExists()to check if project already exists in current directory.checkResourceExists()to check if resource already exists.checkProjectAlreadyExists()andcheckResourceExists()methodsconfirmPrompt()which is used bycheckProjectAlreadyExists()andcheckResourceExists()to reuse same codefilePathfunction which was used in single method, to get path where resource should be generated. Is used for generation and to check if resource existsFileDirtype forfilePathmethod to pick only required params'placementDir' | 'name' | 'extension'getResourceType()to get resource name from path.Checks
Additional information