mirror of
https://github.com/go-task/task.git
synced 2025-08-10 22:42:19 +02:00
feat(defer): expose EXIT_CODE
special variable to defer:
(#1762)
Co-authored-by: Dor Sahar <dorsahar@icloud.com>
This commit is contained in:
@@ -161,6 +161,12 @@ func (e *Executor) compiledTask(call *ast.Call, evaluateShVars bool) (*ast.Task,
|
||||
}
|
||||
continue
|
||||
}
|
||||
// Defer commands are replaced in a lazy manner because
|
||||
// we need to include EXIT_CODE.
|
||||
if cmd.Defer {
|
||||
new.Cmds = append(new.Cmds, cmd.DeepCopy())
|
||||
continue
|
||||
}
|
||||
newCmd := cmd.DeepCopy()
|
||||
newCmd.Cmd = templater.Replace(cmd.Cmd, cache)
|
||||
newCmd.Task = templater.Replace(cmd.Task, cache)
|
||||
|
Reference in New Issue
Block a user