-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
bugThis issue/PR relates to a bug.This issue/PR relates to a bug.
Description
- Cookiecutter version: 2.4.0
- Template project url: N/A
- Python version: 3.10
- Operating System: Linux
Description:
I tried to use the boolean variable. It works great when generating from interactive prompt. But when I try to use --no-input with command line context it doesn't propagate words like "no" or "false" as false value, but rather it seems to take it as string value, so if I pass an empty string it will be evaluated to false.
Here is my cookiecutter.json:
{
"project_name": "test_boolean",
"generate_text": true
}I have a file with template:
{% if cookiecutter.generate_text %}
Hello, world!
{% endif %}
If I run cookiecutter --no-input -f . generate_text=false, the generated file still has the "Hello, world!". But if i use generate_text="" the generated file will be empty.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugThis issue/PR relates to a bug.This issue/PR relates to a bug.