Add file path to YAML error message

This commit is contained in:
ronaudinho
2022-10-07 10:18:53 +00:00
parent fb0e43989d
commit 81de61d8db
4 changed files with 26 additions and 1 deletions

View File

@@ -188,7 +188,10 @@ func readTaskfile(file string) (*taskfile.Taskfile, error) {
return nil, err
}
var t taskfile.Taskfile
return &t, yaml.NewDecoder(f).Decode(&t)
if err := yaml.NewDecoder(f).Decode(&t); err != nil {
return nil, fmt.Errorf("%s: %w", file, err)
}
return &t, nil
}
func exists(path string) (string, error) {