170 Commits

Author SHA1 Message Date
Sigurd Spieckermann
ef5ea4b212 refactor: rename internal modules with a _ prefix 2025-04-22 13:52:51 +02:00
roteiro
465a463ec4
fix(settings): use <CONFIG_ROOT>/copier as settings directory on Windows (#2071)
Deprecate `<CONFIG_ROOT>/copier/copier` and prefer  `<CONFIG_ROOT>/copier` as the settings directory for consistency across operating systems.
2025-04-17 22:05:59 +02:00
Ruslan
1b4bbb7148
docs: Improve documentation for tasks (#2036)
Mention that they run in subprocesses.

Fixes #2035.
2025-03-13 16:52:51 +01:00
Chris Brown
6a6db81b95
docs: fix typo in external data example 2025-03-12 06:40:19 +01:00
jeanluc
55d31e01c2
feat: Add _copier_operation variable (#1733)
* 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
2025-03-09 20:37:12 +00:00
Nathan Simpson
9b0f2b6956
docs: Document behavior of generating destination path when copying (#1498)
* Document behavior of generating destination path when copying

* Update README.md

Co-authored-by: Timothée Mazzucotelli <dev@pawamoy.fr>

* Update docs/generating.md

Co-authored-by: Timothée Mazzucotelli <dev@pawamoy.fr>

* fix: run linting

* Apply suggestions from code review

* Apply suggestions from code review

---------

Co-authored-by: Nathan Simpson <nsimpson@455-g7hgqf4ykt.cust.communityfibre.co.uk>
Co-authored-by: Timothée Mazzucotelli <dev@pawamoy.fr>
2025-03-09 20:02:05 +00:00
Axel H.
1dabe8eb1e
feat(context): expose a _copier_phase context variable 2025-03-02 16:40:57 +01:00
autofix-ci[bot]
3ae6b78be3 style: autoformat with pre-commit 2025-02-16 08:09:11 +00:00
Jairo Llopis
25bc06d01d feat(external_data): load data from other YAML files
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
2025-02-16 08:00:21 +00:00
Axel H.
71358ed397 feat(settings): allow to define some trusted repositories or prefixes 2025-01-29 19:46:06 +01:00
Axel H.
0a9644d249 feat(settings): add user settings support with defaults values (fix #235) 2025-01-29 19:46:06 +01:00
Kj
557c0d6144
feat: add dynamic file structures in loop using yield-tag (#1855)
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
2025-01-18 08:24:32 +00:00
Francesco Calcavecchia
ec11ae28f0
docs: Mention uv tool as an alterative to pipx (#1924)
Co-authored-by: Francesco Calcavecchia <f18771@eon.com>
2025-01-14 14:07:04 +00:00
Piotr
229a13b7fa
docs: Fix context hook extension example (#1877)
Add commas after each dictionary item.
2024-12-02 14:05:47 +01:00
jeanluc
2e7629e3d6
docs: restructure context vars, add undocumented ones (#1856) 2024-11-12 21:54:40 +01:00
Sigurd Spieckermann
b5ef194328 feat: add support for dynamic choices 2024-10-18 19:41:34 +01:00
kenden
ee9918957c
Document how to update when changing a multiselect base answer (#1781)
* 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>
2024-09-22 07:33:20 +00:00
Jairo Llopis
426f5ccdd3
docs(git): tell how to pass HTTPS credentials (#1782)
Fixes https://github.com/copier-org/copier/issues/466
2024-09-21 07:09:36 +01:00
jeanluc
5ac93ee199
fix(updating): do not recreate deleted paths on update (#1719)
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.
2024-08-17 08:44:09 +02:00
Peter Bittner
b8ad16da35
docs: fix ineffective escaping, emphasize error messages (#1671) 2024-06-21 19:42:59 +02:00
Peter Bittner
b581d8d635
docs: add information on aborting an update (#1668) 2024-06-21 11:50:30 +00:00
Adrian Freund
d6f226f2b3
feat: add simpler migrations configuration syntax (#1510) 2024-05-15 11:19:11 +02:00
Rémi Ferrand
73b51448ca
docs: fix pre-commit update rule for .rej files (#1600) 2024-04-22 15:35:15 +02:00
Axel H
4ca2e35ff1
feat(tasks): add support for skipping tasks (#1561)
Co-authored-by: Timothée Mazzucotelli <dev@pawamoy.fr>
Co-authored-by: Sigurd Spieckermann <2206639+sisp@users.noreply.github.com>
2024-04-04 17:35:16 +02:00
Rambaud Pierrick
ee5c106164
docs: improve updating pre-commit documentation (#1361)
- 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>
2024-01-15 18:43:31 +00:00
Sigurd Spieckermann
53aab1f335 docs: prefer "questionnaire" over "questionary" 2023-12-01 08:54:17 +00:00
Jairo Llopis
50d478e19d docs: explain how to use computed variables, more clearly
Fixes https://github.com/copier-org/copier/issues/1414 by documenting a clearer and safe alternative that covers most cases.
2023-11-21 16:45:54 +00:00
Axel H
99bdd11b68 feat(choices): support questionary checkbox for multiple choices using multiselect: true.
Fixes #218
2023-10-30 18:29:55 +00:00
Sigurd Spieckermann
eb492377ed docs: mention Cruft for Cookiecutter in comparison on template updates 2023-10-08 19:36:01 +02:00
Zhiliang
f8614fc96f
docs: add uses cases for updating a project (#1336) 2023-10-01 08:18:38 +01:00
Sigurd Spieckermann
59b8d6d8b0 docs: fix spelling/punctuation/terminology 2023-09-30 19:56:05 +02:00
mspiegel31
61cbe798a7
feat: allow overriding data file with CLI arguments (#1332)
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.
2023-09-29 12:28:37 +01:00
Jannis Mainczyk
74769bc439
docs: improve link text formatting (#1344) 2023-09-26 16:58:20 +02:00
Sigurd Spieckermann
32746bd2a5 fix(cli): use return code 4 for unsafe template error
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.
2023-09-25 10:26:55 +01:00
mspiegel31
a674e64a42
feat(cli): read answers from yaml file (#1325)
Co-authored-by: Sigurd Spieckermann <2206639+sisp@users.noreply.github.com>
2023-09-20 07:12:04 +02:00
Jairo Llopis
ddafdee3ce
docs: placeholders are always strings
Fixes https://github.com/copier-org/copier/issues/1327
2023-09-13 07:42:14 +01:00
Sigurd Spieckermann
97371493e7 docs: unify terminology 2023-09-08 10:28:19 +02:00
Jairo Llopis
448455239f
docs: tell the world about the templated siblings feature
Closes https://github.com/copier-org/copier/issues/1238
2023-09-07 15:30:49 +01:00
Sigurd Spieckermann
d8a667a462 docs: update outdated copier update --force examples 2023-08-28 13:57:16 +02:00
Sigurd Spieckermann
00e51bd94c
feat: add support for pre-update and post-update messages (#1288)
* feat: add support for pre-update and post-update messages

* test: use verbose regex syntax
2023-08-25 10:25:08 +01:00
Sigurd Spieckermann
a75066e34c docs: use autorefs for section references 2023-08-05 20:33:57 +02:00
Sigurd Spieckermann
1031601332 docs: use relative path to Markdown file for page linking 2023-07-19 13:48:49 +02:00
Sigurd Spieckermann
dc94486047 feat: add support for pre-copy and post-copy messages 2023-07-19 13:13:00 +02:00
Sigurd Spieckermann
9218e22807 fix: require default value for secret question 2023-07-19 05:53:26 +01:00
Sigurd Spieckermann
1e81fd5eca
feat: add support for computed values via skipped questions (#1220)
* feat: add support for computed values via skipped questions

* docs: apply review suggestions

Co-authored-by: Jairo Llopis <973709+yajo@users.noreply.github.com>

* docs: update inline comments

* docs: fix formatting

---------

Co-authored-by: Jairo Llopis <973709+yajo@users.noreply.github.com>
2023-07-08 10:36:21 +00:00
Jairo Llopis
0c5a6ca2b4
docs: clarify how to use recopy to recover from broken updates
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>
2023-07-08 10:53:14 +02:00
Jairo Llopis
aaf6cf3843
feat: add --trust as a less scary alternative to --UNSAFE (#1179)
See rationale in https://github.com/copier-org/copier/issues/1137#issuecomment-1579304713.

Co-authored-by: Sigurd Spieckermann <2206639+sisp@users.noreply.github.com>
2023-06-28 21:17:32 +02:00
Colin Marquardt
693d95896c Fix template vs destination folder mixup 2023-06-25 07:59:45 +01:00
Sigurd Spieckermann
1b351bc856 docs: update CLI usage examples to conform with v8
All CLI calls must use a subcommand as the first argument and all flags
must come after the subcommand. See #1143.
2023-06-15 17:17:05 +01:00
Sigurd Spieckermann
4cfe6f63dc feat: add OS identifier to render context 2023-06-14 16:19:40 +01:00