fix: interpolate vars in defer (#2173)

This commit is contained in:
Valentin Maerten
2025-04-21 18:43:20 +02:00
committed by GitHub
parent 84cd4dfdad
commit 7169bf6434
3 changed files with 20 additions and 0 deletions

View File

@@ -297,6 +297,8 @@ func (e *Executor) runDeferred(t *ast.Task, call *Call, i int, deferredExitCode
}
cmd.Cmd = templater.ReplaceWithExtra(cmd.Cmd, cache, extra)
cmd.Task = templater.ReplaceWithExtra(cmd.Task, cache, extra)
cmd.Vars = templater.ReplaceVarsWithExtra(cmd.Vars, cache, extra)
if err := e.runCommand(ctx, t, call, i); err != nil {
e.Logger.VerboseErrf(logger.Yellow, "task: ignored error in deferred cmd: %s\n", err.Error())