feat: add task location data to json output (#1056)

* feat: add task location data to json output

* feat: add root taskfile location to --json output
This commit is contained in:
Pete Davison
2023-03-17 12:34:06 +00:00
committed by GitHub
parent 15ef1fa1c2
commit e40d2eec9e
11 changed files with 169 additions and 44 deletions

View File

@@ -6,9 +6,6 @@ import (
"gopkg.in/yaml.v3"
)
// Tasks represents a group of tasks
type Tasks map[string]*Task
// Task represents a task
type Task struct {
Task string
@@ -39,6 +36,7 @@ type Task struct {
IncludedTaskfileVars *Vars
IncludedTaskfile *IncludedTaskfile
Platforms []*Platform
Location *Location
}
func (t *Task) Name() string {
@@ -162,6 +160,7 @@ func (t *Task) DeepCopy() *Task {
IncludedTaskfileVars: t.IncludedTaskfileVars.DeepCopy(),
IncludedTaskfile: t.IncludedTaskfile.DeepCopy(),
Platforms: deepCopySlice(t.Platforms),
Location: t.Location.DeepCopy(),
}
return c
}