mirror of
https://github.com/go-task/task.git
synced 2025-12-16 11:47:44 +01:00
fix: interpolate vars in defer (#1814)
Co-authored-by: Andrey Nering <andreynering@users.noreply.github.com>
This commit is contained in:
7
task.go
7
task.go
@@ -324,8 +324,13 @@ func (e *Executor) runDeferred(t *ast.Task, call *ast.Call, i int, deferredExitC
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
origTask, err := e.GetTask(call)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
cmd := t.Cmds[i]
|
||||
vars, _ := e.Compiler.FastGetVariables(t, call)
|
||||
vars, _ := e.Compiler.FastGetVariables(origTask, call)
|
||||
cache := &templater.Cache{Vars: vars}
|
||||
extra := map[string]any{}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user