1
0
mirror of https://github.com/go-task/task.git synced 2025-03-17 21:08:01 +02:00

Error if Taskfile_{{GOOS}}.yml version doesn't match Taskfile.yml version

This change is not backward incompatible because merging was already not
working if versions 1 and 2 coexist in Taskfile.yml and Taskfile_{{GOOS}}.yml
This commit is contained in:
Andrey Nering 2018-07-22 17:34:33 -03:00
parent 9f294b4d10
commit da1b0c9558

View File

@ -26,6 +26,9 @@ func Taskfile(dir string) (*taskfile.Taskfile, error) {
if err != nil {
return nil, err
}
if t.Version != osTaskfile.Version {
return nil, fmt.Errorf(`Taskfile versions should match. Taskfile.yml is "%s" but Taskfile_%s.yml is "%s"`, t.Version, runtime.GOOS, osTaskfile.Version)
}
if err = mergo.MapWithOverwrite(&t.Tasks, osTaskfile.Tasks); err != nil {
return nil, err
}