1
0
mirror of https://github.com/go-task/task.git synced 2025-07-17 01:43:07 +02:00

fix: interpolate dynamic vars in defer (#1818)

This commit is contained in:
Valentin Maerten
2024-09-19 14:22:39 +02:00
committed by GitHub
parent 56f3735b38
commit 5eaf0b2dcd
3 changed files with 9 additions and 5 deletions

View File

@ -9,13 +9,17 @@ tasks:
exit-zero:
vars:
FOO: bar
DYNAMIC_FOO:
sh: echo 'bar'
cmds:
- defer: echo FOO={{.FOO}} - {{.PREFIX}}{{.EXIT_CODE}}
- defer: echo FOO={{.FOO}} - DYNAMIC_FOO={{.DYNAMIC_FOO}} - {{.PREFIX}}{{.EXIT_CODE}}
- exit 0
exit-one:
vars:
FOO: bar
DYNAMIC_FOO:
sh: echo 'bar'
cmds:
- defer: echo FOO={{.FOO}} - {{.PREFIX}}{{.EXIT_CODE}}
- defer: echo FOO={{.FOO}} - DYNAMIC_FOO={{.DYNAMIC_FOO}} - {{.PREFIX}}{{.EXIT_CODE}}
- exit 1