1
0
mirror of https://github.com/go-task/task.git synced 2025-07-15 01:35:00 +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

23
help.go
View File

@ -168,7 +168,6 @@ 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(),
@ -181,10 +180,11 @@ func (e *Executor) ToEditorOutput(tasks []*taskfile.Task, noStatus bool) (*edito
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 != "" {
@ -199,20 +199,11 @@ func (e *Executor) ToEditorOutput(tasks []*taskfile.Task, noStatus bool) (*edito
if err != nil { if err != nil {
return err return err
} }
o.Tasks[j] = editors.Task{
Name: task.Name(), o.Tasks[j].UpToDate = upToDate
Desc: task.Desc,
Summary: task.Summary,
UpToDate: upToDate,
Location: &editors.Location{
Line: task.Location.Line,
Column: task.Location.Column,
Taskfile: task.Location.Taskfile,
},
}
return nil return nil
}) })
} }
}
return o, g.Wait() return o, g.Wait()
} }