1
0
mirror of https://github.com/go-task/task.git synced 2025-01-12 04:34:11 +02:00

YAML: Don't use strict unmarshaling anymore

Fixes #112
This commit is contained in:
Andrey Nering 2018-04-28 15:39:54 -03:00
parent db0d847e03
commit bbd6e443b0

View File

@ -44,7 +44,7 @@ func (e *Executor) readTaskfile() error {
func (e *Executor) readTaskfileData(path string) (*taskfile.Taskfile, error) {
if b, err := ioutil.ReadFile(path + ".yml"); err == nil {
var taskfile taskfile.Taskfile
return &taskfile, yaml.UnmarshalStrict(b, &taskfile)
return &taskfile, yaml.Unmarshal(b, &taskfile)
}
return nil, taskFileNotFound{path}
}
@ -56,14 +56,14 @@ func (e *Executor) readTaskvars() error {
)
if b, err := ioutil.ReadFile(file + ".yml"); err == nil {
if err := yaml.UnmarshalStrict(b, &e.taskvars); err != nil {
if err := yaml.Unmarshal(b, &e.taskvars); err != nil {
return err
}
}
if b, err := ioutil.ReadFile(osSpecificFile + ".yml"); err == nil {
osTaskvars := make(taskfile.Vars, 10)
if err := yaml.UnmarshalStrict(b, &osTaskvars); err != nil {
if err := yaml.Unmarshal(b, &osTaskvars); err != nil {
return err
}
for k, v := range osTaskvars {