mirror of
https://github.com/go-task/task.git
synced 2026-09-01 19:50:16 +02:00
fix: accept []string and []int in matrix refs (#2956)
Co-authored-by: no-hup <shauryaj.finance@gmail.com>
This commit is contained in:
11
testdata/for/cmds/Taskfile.yml
vendored
11
testdata/for/cmds/Taskfile.yml
vendored
@@ -4,6 +4,7 @@ vars:
|
||||
OS_VAR: ["windows", "linux", "darwin"]
|
||||
ARCH_VAR: ["amd64", "arm64"]
|
||||
NOT_A_LIST: "not a list"
|
||||
OS_CSV: "windows,linux,darwin"
|
||||
|
||||
tasks:
|
||||
# Loop over a list of values
|
||||
@@ -30,6 +31,16 @@ tasks:
|
||||
ref: .ARCH_VAR
|
||||
cmd: echo "{{.ITEM.OS}}/{{.ITEM.ARCH}}"
|
||||
|
||||
loop-matrix-ref-computed:
|
||||
cmds:
|
||||
- for:
|
||||
matrix:
|
||||
OS:
|
||||
ref: 'splitList "," .OS_CSV'
|
||||
ARCH:
|
||||
ref: .ARCH_VAR
|
||||
cmd: echo "{{.ITEM.OS}}/{{.ITEM.ARCH}}"
|
||||
|
||||
loop-matrix-ref-error:
|
||||
cmds:
|
||||
- for:
|
||||
|
||||
6
testdata/for/cmds/testdata/TestForCmds-loop-matrix-ref-computed.golden
vendored
Normal file
6
testdata/for/cmds/testdata/TestForCmds-loop-matrix-ref-computed.golden
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
windows/amd64
|
||||
windows/arm64
|
||||
linux/amd64
|
||||
linux/arm64
|
||||
darwin/amd64
|
||||
darwin/arm64
|
||||
Reference in New Issue
Block a user