1
0
mirror of https://github.com/go-task/task.git synced 2025-03-19 21:17:46 +02:00

docs: minor updates to the "any variables" experiment page

This commit is contained in:
Andrey Nering 2023-12-20 23:11:50 -03:00
parent e177f48e41
commit 0d209ef05d

View File

@ -32,7 +32,7 @@ tasks:
vars: vars:
BOOL: false BOOL: false
cmds: cmds:
- '{{ if .BOOL }}echo foo{{ end}}' - '{{if .BOOL}}echo foo{{end}}'
``` ```
Arithmetic: Arithmetic:
@ -46,7 +46,7 @@ tasks:
INT: 10 INT: 10
FLOAT: 3.14159 FLOAT: 3.14159
cmds: cmds:
- 'echo {{ add .INT .FLOAT }}' - 'echo {{add .INT .FLOAT}}'
``` ```
Loops: Loops:
@ -59,7 +59,7 @@ tasks:
vars: vars:
ARRAY: [1, 2, 3] ARRAY: [1, 2, 3]
cmds: cmds:
- 'echo {{ range .ARRAY }}{{ . }}{{ end }}' - 'echo {{range .ARRAY}}{{.}}{{end}}'
``` ```
etc. etc.
@ -81,7 +81,7 @@ task:
CALCULATED_VAR: CALCULATED_VAR:
sh: 'echo hello' sh: 'echo hello'
cmds: cmds:
- 'echo {{ .CALCULATED_VAR }}' - 'echo {{.CALCULATED_VAR}}'
``` ```
With this experiment enabled, you will need to remove the `sh` subkey and define With this experiment enabled, you will need to remove the `sh` subkey and define
@ -97,7 +97,7 @@ task:
vars: vars:
CALCULATED_VAR: '$echo hello' CALCULATED_VAR: '$echo hello'
cmds: cmds:
- 'echo {{ .CALCULATED_VAR }}' - 'echo {{.CALCULATED_VAR}}'
``` ```
If your current Taskfile contains a string variable that begins with a `$`, you If your current Taskfile contains a string variable that begins with a `$`, you