1
0
mirror of https://github.com/go-task/task.git synced 2025-08-10 22:42:19 +02:00

feat: looping over dependencies (#1541)

* feat: support for loops in deps

* chore: tests

* docs: looping over deps
This commit is contained in:
Pete Davison
2024-03-10 17:21:50 +00:00
committed by GitHub
parent 29e91a4137
commit f06f48e225
11 changed files with 384 additions and 78 deletions

View File

@@ -9,6 +9,7 @@ import (
// Dep is a task dependency
type Dep struct {
Task string
For *For
Vars *Vars
Silent bool
}
@@ -19,6 +20,7 @@ func (d *Dep) DeepCopy() *Dep {
}
return &Dep{
Task: d.Task,
For: d.For.DeepCopy(),
Vars: d.Vars.DeepCopy(),
Silent: d.Silent,
}
@@ -38,6 +40,7 @@ func (d *Dep) UnmarshalYAML(node *yaml.Node) error {
case yaml.MappingNode:
var taskCall struct {
Task string
For *For
Vars *Vars
Silent bool
}
@@ -45,6 +48,7 @@ func (d *Dep) UnmarshalYAML(node *yaml.Node) error {
return err
}
d.Task = taskCall.Task
d.For = taskCall.For
d.Vars = taskCall.Vars
d.Silent = taskCall.Silent
return nil