1
0
mirror of https://github.com/go-task/task.git synced 2025-01-06 03:53:54 +02:00

chore: add changelog + improve code for #1368

This commit is contained in:
Andrey Nering 2023-11-15 22:38:53 -03:00
parent 8355f16809
commit 834babe0ef
2 changed files with 37 additions and 44 deletions

View File

@ -5,6 +5,8 @@
- Fix bug where dynamic `vars:` and `env:` were being executed when they should - Fix bug where dynamic `vars:` and `env:` were being executed when they should
actually be skipped by `platforms:` (#1273, #1377 by @andreynering). actually be skipped by `platforms:` (#1273, #1377 by @andreynering).
- Fix `schema.json` to make `silent` valid in `cmds` that use `for` (#1385, #1386 by @iainvm). - Fix `schema.json` to make `silent` valid in `cmds` that use `for` (#1385, #1386 by @iainvm).
- Add new `--no-status` flag to skip expensive status checks when running
`task --list --json` (#1348, #1368 by @amancevice).
## v3.31.0 - 2023-10-07 ## v3.31.0 - 2023-10-07

79
help.go
View File

@ -168,51 +168,42 @@ func (e *Executor) ToEditorOutput(tasks []*taskfile.Task, noStatus bool) (*edito
for i := range tasks { for i := range tasks {
task := tasks[i] task := tasks[i]
j := i j := i
if noStatus { g.Go(func() error {
g.Go(func() error { o.Tasks[j] = editors.Task{
o.Tasks[j] = editors.Task{ Name: task.Name(),
Name: task.Name(), Desc: task.Desc,
Desc: task.Desc, Summary: task.Summary,
Summary: task.Summary, UpToDate: false,
UpToDate: false, Location: &editors.Location{
Location: &editors.Location{ Line: task.Location.Line,
Line: task.Location.Line, Column: task.Location.Column,
Column: task.Location.Column, Taskfile: task.Location.Taskfile,
Taskfile: task.Location.Taskfile, },
}, }
}
if noStatus {
return nil return nil
}) }
} else {
g.Go(func() error { // Get the fingerprinting method to use
// Get the fingerprinting method to use method := e.Taskfile.Method
method := e.Taskfile.Method if task.Method != "" {
if task.Method != "" { method = task.Method
method = task.Method }
} upToDate, err := fingerprint.IsTaskUpToDate(context.Background(), task,
upToDate, err := fingerprint.IsTaskUpToDate(context.Background(), task, fingerprint.WithMethod(method),
fingerprint.WithMethod(method), fingerprint.WithTempDir(e.TempDir),
fingerprint.WithTempDir(e.TempDir), fingerprint.WithDry(e.Dry),
fingerprint.WithDry(e.Dry), fingerprint.WithLogger(e.Logger),
fingerprint.WithLogger(e.Logger), )
) if err != nil {
if err != nil { return err
return err }
}
o.Tasks[j] = editors.Task{ o.Tasks[j].UpToDate = upToDate
Name: task.Name(),
Desc: task.Desc, return nil
Summary: task.Summary, })
UpToDate: upToDate,
Location: &editors.Location{
Line: task.Location.Line,
Column: task.Location.Column,
Taskfile: task.Location.Taskfile,
},
}
return nil
})
}
} }
return o, g.Wait() return o, g.Wait()
} }