[Bug]: Default behaviour is to delete the template, even if there's no repo to clone yet
What happened?
I know tools often need sharp edges to work effectively, but I've cut myself on this particular case so many times I need to warn people; the default behaviour of cookiecutter is to delete the template dir. This is very annoying when you are creating a new template. For example, make a minimal working cookiecutter template called 'something':
mkdir -p ~/.cookiecutters/cookiecutter-something/{{cookiecutter.app_name}} && echo '{ "app_name": "my_project" }' > ~/.cookiecutters/cookiecutter-something/cookiecutter.jsonNow, cookiecutter ~/.cookiecutters/cookiecutter-something works and produces an empty directory my_project.
But cookiecutter gh:AnyUserNameEvenAnInvalidOne/cookiecutter-something --no-input, although it helpfully emits a warning:
The repository https://github.com/AnyUserNameEvenAnInvalidOne/cookiecutter-something.git could not be found, have you made a typo?... it also silently, irreversibly deletes the template dir.
The default should not be to delete the existing template and then try to download the given url. At the very least, we should first check we can download it before deleting, but really the default should be to go into the existing template dir and do a git pull.
Steps to reproduce
mkdir -p ~/.cookiecutters/cookiecutter-something/{{cookiecutter.app_name}} && echo '{ "app_name": "my_project" }' > ~/.cookiecutters/cookiecutter-something/cookiecutter.json
cookiecutter gh:AnyUserNameEvenAnInvalidOne/cookiecutter-something --no-inputTemplate
No response
Output / traceback
Cookiecutter version
2.6.0
Python version
3.10
Operating system
Linux
How did you install Cookiecutter?
pip
Additional context
No response
Source: cookiecutter/cookiecutter