1
0
mirror of https://github.com/go-task/task.git synced 2025-03-03 14:52:13 +02:00

Merge pull request #407 from bryceschober/patch-1

Use {{default}} for an overriding usage
This commit is contained in:
Andrey Nering 2021-01-01 19:21:50 -03:00 committed by GitHub
commit 6a4315b7e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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`.