-
The documentation says about My problem is that I want to calculate some values based on the answers already given, and name the result. My use case is that I want to generate a file based on some messy conditions, and a file name of the form This is possible in the copier.yml file by doing:
Is this a good idea? If so, would it be a useful addition to the documentation (maybe as a FAQ entry)? Or is there a better way of doing this that I haven't spotted? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I guess another option would be to modify the context which hides away some internals from the questions file. |
Beta Was this translation helpful? Give feedback.
-
As the docs say: Lines 144 to 147 in c16b0b8 But if we use It could be a behaviour, but it could lead to surprises, like: why did Copier update this question if I didn't answer it? And I like to keep it predictable whenever possible. This has been discussed before. You can see the whole story in #629. It contains some ideas that can serve you. In short, since there's an extension that handles that case, I'm deliberately not supporting it upstream, to keep Copier on scope. |
Beta Was this translation helpful? Give feedback.
As the docs say:
copier/docs/configuring.md
Lines 144 to 147 in c16b0b8
But if we use
when
to have computed values, then we'd have to process the answer always, no matter if it has changed in a previous update.It could be a behaviour, but it could lead to surprises, like: why did Copier update this question if I didn't answer it? And I like to keep it predictable whenever possible.
This has been discussed before. You can see the whole story in #629. It contains some ideas that can…