question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] Add a command-line parameter so cookiecutter just replace the cached cookiecutter repository

See original GitHub issue
  • Cookiecutter version: 1.6.0
  • Template project url: None
  • Python version: 3.7
  • Operating System: macOS

Description:

I’m proposing a feature here to add a command-line parameter, so cookiecutter will automatically update the cached cookiecutter repository.

So, we can enforce everyone to have the cookiecutter repository updated.

Proposed Behaviour

Previously

Cookiecutter will ask whether to update the cache or not.

$ cookiecutter [REPO]
You've downloaded /home/nieltg/.cookiecutters/skeleton-ruby before. Is it okay to delete and re-download it? [yes]: 
Enter passphrase for key '/home/nieltg/.ssh/id_rsa': 

Proposed

We can put a command-line parameter so cookiecutter just updates the cache.

$ cookiecutter --refresh [REPO]
Enter passphrase for key '/home/nieltg/.ssh/id_rsa': 

Thank you very much! If that’s possible, I’m willing to make a pull request in my free time.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
svermeulencommented, Nov 2, 2019

Yes I find this prompt annoying every time I use cookiecutter with a URL. I would much prefer that it use the cache by default unless it gets over-ridden with --refresh

0reactions
glumiacommented, May 3, 2021

But in this case, it would be sufficient to provide the following command to those less technical people (suppose the template is cookiecutter-pypackage):

rm -rf ~/.cookiecutters/cookiecutter-pypackage && cookiecutter gh:audreyfeldroy/cookiecutter-pypackage

Is it really worth maintaining a new feature just to not use this compound command?

Do not underestimate the maintenance effort: it is true that the implementation is trivial and that it has some value (cookiecutter --refresh gh:audreyfeldroy/cookiecutter-pypackage is definitely prettier than the command above) but after that it’s added we would have to take care of it forever. Breaking retro compatibility is way worse than not providing a feature in the first place. And think of what happens when ‘smaller features’ like this one are added one after the other: in no time you find yourself with an enormous codebase where even the smallest change is expensive.

So, in my opinion, this feature is not worth it. (you can ask other maintainers a feedback if you don’t agree)

PS: Please don’t take it personally, I’m really sorry to block this request but it’s to prevent cookiecutter from growing indefinitely!

Read more comments on GitHub >

github_iconTop Results From Across the Web

cookiecutter 1.7.0 documentation - Read the Docs
A command-line utility that creates projects from cookiecutters (project templates), e.g. creating a Python package project from a Python package project ...
Read more >
cookiecutter 1.1.0 - PyPI
A command-line utility that creates projects from project templates, e.g. creating a Python package project from a Python package project template.
Read more >
12 Organizing Your Code Projects with Git - Invent with Python
The cookiecutter module uses templates to create the starting files for several different kinds of projects. Often, the template is simply a GitHub.com...
Read more >
Writing extensions tutorial — CKAN 2.9.7 documentation
You can use cookiecutter command to create an “empty” extension from a template. ... the -o option), so change to the directory that...
Read more >
Can you Integrate a Cookiecutter template with the Github ...
The GitHub Template feature is nice because (a) it shows up in the "create repo" menu and (b) the new repo retains an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found