(node *yaml.Node)
| 110 | } |
| 111 | |
| 112 | func (t *Task) UnmarshalYAML(node *yaml.Node) error { |
| 113 | switch node.Kind { |
| 114 | |
| 115 | // Shortcut syntax for a task with a single command |
| 116 | case yaml.ScalarNode: |
| 117 | var cmd Cmd |
| 118 | if err := node.Decode(&cmd); err != nil { |
| 119 | return errors.NewTaskfileDecodeError(err, node) |
| 120 | } |
| 121 | t.Cmds = append(t.Cmds, &cmd) |
| 122 | return nil |
| 123 | |
| 124 | // Shortcut syntax for a simple task with a list of commands |
| 125 | case yaml.SequenceNode: |
| 126 | var cmds []*Cmd |
| 127 | if err := node.Decode(&cmds); err != nil { |
| 128 | return errors.NewTaskfileDecodeError(err, node) |
| 129 | } |
| 130 | t.Cmds = cmds |
| 131 | return nil |
| 132 | |
| 133 | // Full task object |
| 134 | case yaml.MappingNode: |
| 135 | var task struct { |
| 136 | Cmds []*Cmd |
| 137 | Cmd *Cmd |
| 138 | Deps []*Dep |
| 139 | Label string |
| 140 | Desc string |
| 141 | Prompt Prompt |
| 142 | Summary string |
| 143 | Aliases []string |
| 144 | Sources []*Glob |
| 145 | Generates []*Glob |
| 146 | Status []string |
| 147 | Preconditions []*Precondition |
| 148 | Dir string |
| 149 | Set []string |
| 150 | Shopt []string |
| 151 | Vars *Vars |
| 152 | Env *Vars |
| 153 | Dotenv []string |
| 154 | Silent *bool `yaml:"silent,omitempty"` |
| 155 | Interactive bool |
| 156 | Internal bool |
| 157 | Method string |
| 158 | Prefix string |
| 159 | IgnoreError bool `yaml:"ignore_error"` |
| 160 | UseGitignore *bool `yaml:"use_gitignore,omitempty"` |
| 161 | Run string |
| 162 | Platforms []*Platform |
| 163 | If string |
| 164 | Requires *Requires |
| 165 | Watch bool |
| 166 | Failfast bool |
| 167 | } |
| 168 | if err := node.Decode(&task); err != nil { |
| 169 | return errors.NewTaskfileDecodeError(err, node) |
nothing calls this directly
no test coverage detected