Skip to content

Commit

Permalink
Error if Taskfile_{{GOOS}}.yml version doesn't match Taskfile.yml ver…
Browse files Browse the repository at this point in the history
…sion

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
  • Loading branch information
andreynering committed Jul 22, 2018
1 parent 9f294b4 commit da1b0c9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/taskfile/read/taskfile.go
Expand Up @@ -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
}
Expand Down

0 comments on commit da1b0c9

Please sign in to comment.