Description
When using for loop with a variable defined in an included Taskfile, the variable is empty/not accessible. This applies to complex variables (list of objects).
Taskfile.yml
`version: "3"
includes:
proc: ./proc_task.yml
tasks:
features-sample-run:
for:
var: PROCESS_FEATURES
cmd: |
echo "Processing feature {{.ITEM.id}}"
{{if .ITEM.macros}}echo " Macros: {{.ITEM.macros}}"{{end}}`
proc_task.yml
`version: "3"
vars:
PROCESS_FEATURES:
- id: 1
- id: 2
macros: -DUW_RINGBUF
- id: 3
macros: -DUW_RINGBUF -DUW_FENTRY
Output
$ task features-sample-run
task: [features-sample-run] echo "Processing feature "
Processing feature
Expected behavior
The for loop should iterate over the PROCESS_FEATURES list and output:
Processing feature 1
Processing feature 2
Macros: -DUW_RINGBUF
Processing feature 3
Macros: -DUW_RINGBUF -DUW_FENTRY
What I tried
for: { var: PROCESS_FEATURES } — empty
for: { var: proc.PROCESS_FEATURES } — empty
- Using
vars: FEATURES: '{{.proc.PROCESS_FEATURES}}' then for: { var: FEATURES } — empty
Related issues
Version
Description
When using for loop with a variable defined in an included Taskfile, the variable is empty/not accessible. This applies to complex variables (list of objects).
Taskfile.yml
proc_task.yml
Output
Expected behavior
The
forloop should iterate over thePROCESS_FEATURESlist and output:What I tried
for: { var: PROCESS_FEATURES }— emptyfor: { var: proc.PROCESS_FEATURES }— emptyvars: FEATURES: '{{.proc.PROCESS_FEATURES}}'thenfor: { var: FEATURES }— emptyRelated issues
Version