1
0
mirror of https://github.com/go-task/task.git synced 2024-12-12 10:45:49 +02:00

feat: add aliases to --json output

This commit is contained in:
Pete Davison 2023-12-18 09:45:41 +00:00 committed by Andrey Nering
parent edb9dcd284
commit c5a2e92e5e
2 changed files with 6 additions and 0 deletions

View File

@ -168,11 +168,16 @@ func (e *Executor) ToEditorOutput(tasks []*taskfile.Task, noStatus bool) (*edito
for i := range tasks {
task := tasks[i]
j := i
aliases := []string{}
if len(task.Aliases) > 0 {
aliases = task.Aliases
}
g.Go(func() error {
o.Tasks[j] = editors.Task{
Name: task.Name(),
Desc: task.Desc,
Summary: task.Summary,
Aliases: aliases,
UpToDate: false,
Location: &editors.Location{
Line: task.Location.Line,

View File

@ -11,6 +11,7 @@ type (
Name string `json:"name"`
Desc string `json:"desc"`
Summary string `json:"summary"`
Aliases []string `json:"aliases"`
UpToDate bool `json:"up_to_date"`
Location *Location `json:"location"`
}