Open davidbrownell opened 4 months ago
That's probably because it's getting the answer from the last update. Try with this:
one_nested:
type: bool
when: "{{ project_type == 'One' and one_question }}"
default: False
two_nested:
type: bool
when: "{{ project_type == 'Two' and two_question }}"
default: False
That's probably because it's getting the answer from the last update.
That's what I suspected too. Does that make sense though? Shouldn't we have recopy
do this only, and not copy
?
Describe the problem
I have a template with a choice of 2 values, where a different question should be asked based on the previous choice.
In addition, an additional question should be asked if the response to one of the choice-specific questions was True:
Things work as expected when running
copier copy...
the first time around. However, when runningcopier copy...
(on the same target directory) with a different choice, copier prompts for an answer to the original nested question in addition to the nested question associated with the new choice (this is clearer in the screenshots below).Template
https://github.com/davidbrownell/copier-TemplateIssue
To Reproduce
copier copy https://github.com/davidbrownell/copier-TemplateIssue <output_dir>
project_type: One
,one_question: Y
,one_nested: Y
copier copy https://github.com/davidbrownell/copier-TemplateIssue <output_dir>
project_type: Two
one_nested
even thoughone_question
has defaulted to False.Logs
No response
Expected behavior
one-related questions should not be asked when the project_type is set to Two.
Screenshots/screencasts/logs
Operating system
Windows
Operating system distribution and version
Windows 11
Copier version
copier 9.3.1
Python version
CPython 3.12
Installation method
pip+pypi
Additional context
No response