Description
when creating dynamic variables like files: sh: "find ." in multiple subfolders, they won't be correctly evaluated. Due to internal caching, only the first result will be used.
Posted PR with reproduction and fix: #2160
Sample input
Folder structure:
root/
├── Taskfile.yaml
└── sub1/
├── Taskfile.yaml
└── a
└── sub2/
├── Taskfile.yaml
└── b
Taskfile.yml
version: '3'
run: when_changed
silent: true
output: prefixed
includes:
s1:
taskfile: sub1
dir: sub1
s2:
taskfile: sub2
dir: sub2
tasks:
all:
deps:
- s1:all
- s2:all
sub1/Taskfile.yaml, sub2/Taskfile.yaml:
version: '3'
vars:
files:
sh: "find ."
tasks:
all:
cmds:
- cmd: 'echo "{{.files}}"'
Actual output:
$ task all
[s2:all] .
[s2:all] ./Taskfile.yml
[s2:all] ./b
[s1:all] .
[s1:all] ./Taskfile.yml
[s1:all] ./b
Note how "s1" lists file "b", which is incorrect.
Description
when creating dynamic variables like
files: sh: "find ."in multiple subfolders, they won't be correctly evaluated. Due to internal caching, only the first result will be used.Posted PR with reproduction and fix: #2160
Sample input
Folder structure:
Taskfile.ymlsub1/Taskfile.yaml,sub2/Taskfile.yaml:Actual output:
Note how "s1" lists file "b", which is incorrect.