fix: ensure that calls to other tasks can be silenced (#680)

This commit is contained in:
Mads H. Danquah
2023-04-27 08:23:45 +02:00
committed by Andrey Nering
parent f0e9751f7e
commit 9a406f5998
7 changed files with 142 additions and 13 deletions

View File

@@ -2,6 +2,7 @@ package taskfile
// Call is the parameters to a task call
type Call struct {
Task string
Vars *Vars
Task string
Vars *Vars
Silent bool
}

View File

@@ -99,6 +99,7 @@ func (c *Cmd) UnmarshalYAML(node *yaml.Node) error {
if err := node.Decode(&taskCall); err == nil && taskCall.Task != "" {
c.Task = taskCall.Task
c.Vars = taskCall.Vars
c.Silent = cmdStruct.Silent
return nil
}

View File

@@ -8,8 +8,9 @@ import (
// Dep is a task dependency
type Dep struct {
Task string
Vars *Vars
Task string
Vars *Vars
Silent bool
}
func (d *Dep) DeepCopy() *Dep {
@@ -35,14 +36,16 @@ func (d *Dep) UnmarshalYAML(node *yaml.Node) error {
case yaml.MappingNode:
var taskCall struct {
Task string
Vars *Vars
Task string
Vars *Vars
Silent bool
}
if err := node.Decode(&taskCall); err != nil {
return err
}
d.Task = taskCall.Task
d.Vars = taskCall.Vars
d.Silent = taskCall.Silent
return nil
}