Status returns an error if any the of given tasks is not up-to-date
(ctx context.Context, calls ...*Call)
| 10 | |
| 11 | // Status returns an error if any the of given tasks is not up-to-date |
| 12 | func (e *Executor) Status(ctx context.Context, calls ...*Call) error { |
| 13 | for _, call := range calls { |
| 14 | |
| 15 | // Compile the task |
| 16 | t, err := e.CompiledTask(call) |
| 17 | if err != nil { |
| 18 | return err |
| 19 | } |
| 20 | |
| 21 | // Get the fingerprinting method to use |
| 22 | method := e.Taskfile.Method |
| 23 | if t.Method != "" { |
| 24 | method = t.Method |
| 25 | } |
| 26 | |
| 27 | // Check if the task is up-to-date |
| 28 | isUpToDate, err := fingerprint.IsTaskUpToDate(ctx, t, |
| 29 | fingerprint.WithMethod(method), |
| 30 | fingerprint.WithTempDir(e.TempDir.Fingerprint), |
| 31 | fingerprint.WithDry(e.Dry), |
| 32 | fingerprint.WithLogger(e.Logger), |
| 33 | ) |
| 34 | if err != nil { |
| 35 | return err |
| 36 | } |
| 37 | if !isUpToDate { |
| 38 | return fmt.Errorf(`task: Task "%s" is not up-to-date`, t.Name()) |
| 39 | } |
| 40 | } |
| 41 | return nil |
| 42 | } |
| 43 | |
| 44 | func (e *Executor) statusOnError(t *ast.Task) error { |
| 45 | method := t.Method |