-
-
Notifications
You must be signed in to change notification settings - Fork 727
Open
Labels
state: needs triageWaiting to be triaged by a maintainer.Waiting to be triaged by a maintainer.
Description
Description
It seems that every time a defer:
command is run, variable templates are re-evaluated. This is problematic when using nondeterministic variable definitions that include things like the randInt
builtin. In addition, this breaks from the behavior of normal commands where all executions seem to share the same variable values.
For example, I would expect the example task to print the same path value 4 times, but instead it prints 2 of the same path then 2 more different paths (a total of 3 unique paths).
Version
3.43.2
Operating system
Windows
Experiments Enabled
No response
Example Taskfile
tasks:
test:
vars:
DIR: '{{.ROOT_DIR}}/temp-{{randInt 1000000 9999999}}'
cmds:
- echo "{{.DIR}}"
- defer: echo "{{.DIR}}"
- defer: echo "{{.DIR}}"
- echo "{{.DIR}}"
jtkiesel and wburningham
Metadata
Metadata
Assignees
Labels
state: needs triageWaiting to be triaged by a maintainer.Waiting to be triaged by a maintainer.