You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
More of a question rather than an issue:
I've worked with both pre_gen and post_gen hooks which are great. But I really want some way to run a custom script to set some cookiecutter variables while generating the cookiecutter project.
For example I've made a script that pulls the person's name from the system's global git config file and would love to have that data injected into the cookiecutter.json so that I can use cookiecutter._git_user to set it somewhere in the rest of the project(a README in my case).
Now this script doesn't work of course because you can't access the cookiecutter.json with the pre_gen or post_gen hooks.
Is it possible to get this working some way?
All I can think of so far is to generate the README.md manually in the post_gen hook and add the username this way.
The text was updated successfully, but these errors were encountered:
This will be covered once #1240 is merged. You will be able to package your custom logic into a local Jinja extension and access it from all your templates.
Description:
More of a question rather than an issue:
I've worked with both pre_gen and post_gen hooks which are great. But I really want some way to run a custom script to set some cookiecutter variables while generating the cookiecutter project.
For example I've made a script that pulls the person's name from the system's global git config file and would love to have that data injected into the cookiecutter.json so that I can use cookiecutter._git_user to set it somewhere in the rest of the project(a README in my case).
Now this script doesn't work of course because you can't access the cookiecutter.json with the pre_gen or post_gen hooks.
Is it possible to get this working some way?
All I can think of so far is to generate the README.md manually in the post_gen hook and add the username this way.
The text was updated successfully, but these errors were encountered: