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
I'd expect the conditional {% if cookiecutter.var %} not to be true if the cookiecutter.var is false.
But {% if cookiecutter.var %} produces output no matter if var=False or var=True
What I've run:
$ python3 -m venv /path/to/dir
$ cd /path/to/dir
$ bin/pip install cookiecutter==2.1.1
$ rm -rf mycookiecutter
$ mkdir mycookiecutter
$ mkdir mycookiecutter/\{\{\ cookiecutter.target\ \}\}
$ cat <<'EOF' | tee mycookiecutter/cookiecutter.json
> {
> "target": "test",
> "var": false
> }
> EOF
$ cat <<'EOF' | tee mycookiecutter/\{\{\ cookiecutter.target\ \}\}/output
> {% if cookiecutter.var %}
> conditional expression is true. var is {{ cookiecutter.var }}
> {% else %}
> conditional expression is false. var is {{ cookiecutter.var }}
> {% endif %}
> EOF
Calling bin/cookiecutter -f mycookiecutter either with var=False or var=True the result is the same
$ bin/cookiecutter -f mycookiecutter && cat test/outputtarget [test]: var [False]: conditional expression is true. var is False
$ bin/cookiecutter -f mycookiecutter && cat test/outputtarget [test]: var [False]: True conditional expression is true. var is True
The text was updated successfully, but these errors were encountered:
Description:
I'd expect the conditional
{% if cookiecutter.var %}
not to be true if thecookiecutter.var
isfalse
.But
{% if cookiecutter.var %}
produces output no matter ifvar=False
orvar=True
What I've run:
Calling
bin/cookiecutter -f mycookiecutter
either withvar=False
orvar=True
the result is the sameThe text was updated successfully, but these errors were encountered: