-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail fast on directory already exists #821
Comments
I see how checking the target directory while prompting would improve the user experience. Do you want to create a PR, @ssteinerx? |
Unfortunately, The 'context' is just the parsed Special-casing this one thing by name could be done but ick. Without major rearrangement of |
Thanks for investigating, @ssteinerx! 🙇 Sounds like another feature for #848 to me. |
@hackebrot Yes, I didn't have time to read the spec, but this type of fail-fast should be built in somehow. |
I see that we can decorate the For example if it detects a key named I think it's possible to do with out breaking changes. That will be a chance to refactor the |
@theodesp I haven't looked at this in quite a while (like 8 months!), but I remember thinking that I'd want to have a way of indicating that I haven't got time to look right this second, but I vaguely remember wanting something like: prompt("Create the docs directory?", action_type="create-directory", validator="prompt-overwrite-if-exists-or-exit") |
Yes thats another good idea. As you said |
Description:
If the destination directory already exists (based on the project name), cookiecutter fails after all questions are asked.
What I've run:
cookiecutter, fill out name of existing directory should fail as soon as it can detect, not after answering all of the questions.
The text was updated successfully, but these errors were encountered: