1
0
mirror of https://github.com/go-task/task.git synced 2025-06-16 04:20:56 +03:00

add checksum based status check, alternative to timestamp based

This commit is contained in:
Andrey Nering
2017-09-16 11:44:13 -03:00
parent 95f7b9443f
commit c295a1998a
15 changed files with 315 additions and 97 deletions

View File

@ -49,6 +49,7 @@ type Tasks map[string]*Task
// Task represents a task
type Task struct {
Task string
Cmds []*Cmd
Deps []*Dep
Desc string
@ -60,6 +61,7 @@ type Task struct {
Set string
Env Vars
Silent bool
Method string
}
// Run runs Task
@ -135,14 +137,17 @@ func (e *Executor) RunTask(ctx context.Context, call Call) error {
return err
}
if upToDate {
e.printfln(`task: Task "%s" is up to date`, call.Task)
e.printfln(`task: Task "%s" is up to date`, t.Task)
return nil
}
}
for i := range t.Cmds {
if err := e.runCommand(ctx, t, call, i); err != nil {
return &taskRunError{call.Task, err}
if err2 := t.statusOnError(); err2 != nil {
e.verbosePrintfln("task: error cleaning status on error: %v", err2)
}
return &taskRunError{t.Task, err}
}
}
return nil