mirror of
https://github.com/go-task/task.git
synced 2026-06-29 15:44:30 +00:00
Manually implement merging of Taskfiles and remove dependency on github.com/imdario/mergo
I was carreful enough to check the behavior keeps the same
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
|
||||
"github.com/go-task/task/internal/taskfile"
|
||||
|
||||
"github.com/imdario/mergo"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
@@ -26,10 +25,7 @@ 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 {
|
||||
if err = taskfile.Merge(t, osTaskfile); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user