1
0
mirror of https://github.com/go-task/task.git synced 2025-06-27 00:51:05 +02:00

feat: set and shopt directives (#929)

Co-authored-by: Andrey Nering <andrey@nering.com.br>
This commit is contained in:
Pete Davison
2023-01-14 13:41:56 -06:00
committed by GitHub
parent 4be1050234
commit 1c1be683ab
15 changed files with 308 additions and 19 deletions

View File

@ -11,6 +11,8 @@ type Cmd struct {
Cmd string
Silent bool
Task string
Set []string
Shopt []string
Vars *Vars
IgnoreError bool
Defer bool
@ -40,12 +42,16 @@ func (c *Cmd) UnmarshalYAML(node *yaml.Node) error {
var cmdStruct struct {
Cmd string
Silent bool
Set []string
Shopt []string
IgnoreError bool `yaml:"ignore_error"`
Platforms []*Platform
}
if err := node.Decode(&cmdStruct); err == nil && cmdStruct.Cmd != "" {
c.Cmd = cmdStruct.Cmd
c.Silent = cmdStruct.Silent
c.Set = cmdStruct.Set
c.Shopt = cmdStruct.Shopt
c.IgnoreError = cmdStruct.IgnoreError
c.Platforms = cmdStruct.Platforms
return nil