If I have variables in cookiecutter.json
like so:
{
"app": {
"name": "myapp",
"description": "my app description",
"version": "v1",
"ecr_data_classification_tag": "non-pii"
},
"contact": {
"team": "monitors",
"name": "WS Monitors",
"url": "http://myurl.tld/"
},
"etc": "foo"
}
How do I override the app name
when invoking cookiecutter?
I've tried supplying the "extra context" this way:
$ cookiecutter --no-input my-template app.name="my-new-name"
and:
$ cookiecutter --no-input my-template app='{"name":"my-new-name"}'
but the former does nothing and the latter just replaces the entire app
parameter with the string {\"name\":\"my-new-name\"}
(it doesn't parse the JSON).
I tried dumping the whole thing into a yaml file, and that works:
default_context:
app:
name: my-new-name
but that's not ideal. It also wipes out all the other app
parameters.
Is there a way to invoke cookiecutter from the command-line and just override app.name
?