MCPcopy
hub / github.com/go-task/task / Status

Method Status

status.go:12–42  ·  view source on GitHub ↗

Status returns an error if any the of given tasks is not up-to-date

(ctx context.Context, calls ...*Call)

Source from the content-addressed store, hash-verified

10
11// Status returns an error if any the of given tasks is not up-to-date
12func (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
44func (e *Executor) statusOnError(t *ast.Task) error {
45 method := t.Method

Callers 2

runMethod · 0.95
runFunction · 0.95

Calls 7

CompiledTaskMethod · 0.95
IsTaskUpToDateFunction · 0.92
WithMethodFunction · 0.92
WithTempDirFunction · 0.92
WithDryFunction · 0.92
WithLoggerFunction · 0.92
NameMethod · 0.80

Tested by 1

runMethod · 0.76