-
-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditional argument ignored when updating #1727
Comments
Seems a theoretical valid case, but what's the real use case for such feature? I mean: why would you need an answer whose |
In the simple example I could just specify the |
Sounds like hacking the answer system to customize the CLI interactivity. I sometimes wonder if Copier shouldn't provide some kind of wrapper around it to build more flexible CLIs/TUIs without having to twist its internals. Some kind of Textual form, for example. |
I wonder whether we should disallow overriding answers to hidden questions ( |
That makes sense @sisp. However, that won't fix the fact that skipped answers (when=false) won't be stored. @lhupfeldt have you tried hacking the # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
{{ dict(_copier_answers, with_internal1=with_internal1) | to_nice_yaml -}} This way you hardcode a key that's gonna be sometimes skipped in the questionary. FWIW, keep in mind that, during updates, if you pass |
Describe the problem
Commandline data argument is ignored when commandline value is changed during update.
Argument is not remembered in answers file.
Template
copier_ignored_arg_bug.zip
To Reproduce
Create a copier.yaml with an argument which is conditional based on another argument.
Git commit template.
Expand template with "hidden" data arg specified on commandline.
Value of
with_internal1
is correctly expanded asTrue
in template file, but is not store in answers file.Commit subproject.
Make a change in template, e.g. the message. Commit.
Update subproject with new value of
with_internal1
Value of
with_internal1
is unchanged and remains expanded asTrue
in template file! The template file is unchanged, only answers file is update (with new git commit).Logs
No response
Expected behavior
The template file should be updated with the value specified on commandline.
Copier should save the value in the answers file.
Screenshots/screencasts/logs
No response
Operating system
Linux
Operating system distribution and version
Fedora
Copier version
9.3.1
Python version
3.11.8
Installation method
pip+pypi
Additional context
No response
The text was updated successfully, but these errors were encountered: