1
0
mirror of https://github.com/go-task/task.git synced 2025-08-10 22:42:19 +02:00

Use {{default}} for an overriding usage

Fixes documentation confusion raised in #376.
This commit is contained in:
Bryce Schober
2020-11-18 17:09:44 -08:00
committed by GitHub
parent b136166fc9
commit bf88bd5da5

View File

@@ -269,16 +269,16 @@ attribute:
version: '3'
tasks:
main-task:
greet:
vars:
RECIPIENT: '{{default "World" .RECIPIENT}}'
cmds:
- task: write-file
vars: {FILE: "hello.txt", CONTENT: "Hello!"}
- task: write-file
vars: {FILE: "world.txt", CONTENT: "World!"}
- echo "Hello, {{.RECIPIENT}}!"
write-file:
greet-pessimistically:
cmds:
- echo "{{.CONTENT}}" > {{.FILE}}
- task: greet
vars: {RECIPIENT: "Cruel World"}
```
The above syntax is also supported in `deps`.