* Makes `exclude` configuration templatable.
* Adds a `_copier_operation` variable to the rendering contexts for `exclude` and `tasks`, representing the current operation - either `copy`~~, `recopy`~~ or `update`.
This was proposed here: https://github.com/copier-org/copier/issues/1718#issuecomment-2282643624
When composing templates, it's often needed to be able to load answers from other templates that you know are usually combined with yours. Or any other kind of external data.
@moduon MT-8282
Add jinja2 extension for yield tag, allow _render_path to generate multiple paths and contexts when yield tag is used.
The tag is only allowed in path render contexts. When rendering within a file, it doesn't make sense. Use the normal for tag there. If you use yield, you'll get an exception.
Fixes https://github.com/copier-org/copier/issues/1271
* Document how to update when changing a multiselect base answer
The documentation to update, changing only one answer when the question is a multi-select base choice, is missing.
This is from https://github.com/copier-org/copier/issues/1474#issuecomment-2328522026, but it also indicate to create the `.yaml` file in another directory (to avoid error `Destination repository is dirty; cannot continue. Please commit or stash your local changes and retry.`).
* style: autoformat with pre-commit
* docs: adapt to global copywriting style
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jairo Llopis <973709+yajo@users.noreply.github.com>
Previously, paths that matched a pattern in `skip_if_exists` and that were deleted in the generated project were recreated during each update. This was expected, because the file now didn't exist, and thus it's considered new. However, it might be surprising to some, so docs are updated and a test now makes that an officially supported use case.
For the rest of files, they shouldn't be recreated, even if the template changed. A user that deletes the file is kind of expressing their will to ignore that file from now on. To recover it, they can just recopy the template.
BREAKING CHANGE: If you delete a file in your subproject, it will not be recreated if it changes in the template and you update the subproject. Recopy if you need it back.
- there was a inconsistence between the inline and rej default. as it's inline I changed the value in the corrected section
- as users won't need the 2 options at once, I split the 2 hooks.
- specified that both repos can be used at once
Co-authored-by: Sigurd Spieckermann <2206639+sisp@users.noreply.github.com>
Users should be able to pass CLI data arguments and use a `--data-file` at the same time. Let's just take inspiration from the [helm values file](https://helm.sh/docs/chart_template_guide/values_files/) and give highest priority to data values passed at the command line.
BREAKING CHANGE: Changes the return code for unsafe template error from
2 to 4 to avoid return code collision with Plumbum's `SwitchError` type
errors which use return code 2.
Docs were a bit repetitive and unclear.
Targets https://github.com/copier-org/copier/issues/1170. It could even fix it?
Co-authored-by: Timothée Mazzucotelli <pawamoy@pm.me>
Co-authored-by: Sigurd Spieckermann <2206639+sisp@users.noreply.github.com>