File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -858,6 +858,18 @@ to know available options.
858
858
859
859
The CLI option can be passed several times to add several patterns.
860
860
861
+ Each pattern can be templated using Jinja.
862
+
863
+ !!! example
864
+
865
+ Templating `exclude` patterns using `_copier_conf.operation` allows to have files
866
+ that are rendered once during `copy`, but are never updated :
867
+
868
+ ` ` ` yaml
869
+ _exclude:
870
+ - '{%- if _copier_conf.operation == "update" -%}src/*_example.py{%- endif %}'
871
+ ` ` `
872
+
861
873
!!! info
862
874
863
875
When you define this parameter in `copier.yml`, it will **replace** the default
@@ -1316,6 +1328,8 @@ configuring `secret: true` in the [advanced prompt format][advanced-prompt-forma
1316
1328
exist, but always be present. If they do not exist in a project during an `update`
1317
1329
operation, they will be recreated.
1318
1330
1331
+ Each pattern can be templated using Jinja.
1332
+
1319
1333
!!! example
1320
1334
1321
1335
For example, it can be used if your project generates a password the 1st time and
Original file line number Diff line number Diff line change @@ -99,3 +99,4 @@ Copier includes:
99
99
- It contains the current commit hash from the template in
100
100
` {{ _copier_conf.vcs_ref_hash }}` .
101
101
- Contains Operating System-specific directory separator under `sep` key.
102
+ - It also contains the current `operation` (`copy` | `recopy` | `update`).
You can’t perform that action at this time.
0 commit comments