mirror of
https://github.com/go-task/task.git
synced 2026-06-11 09:51:50 +00:00
feat: add support for multiple includes on a graph edge
This commit is contained in:
@@ -79,17 +79,19 @@ func (tfg *TaskfileGraph) Merge() (*Taskfile, error) {
|
||||
}
|
||||
|
||||
// Get the merge options
|
||||
include, ok := edge.Properties.Data.(*Include)
|
||||
includes, ok := edge.Properties.Data.([]*Include)
|
||||
if !ok {
|
||||
return fmt.Errorf("task: Failed to get merge options")
|
||||
}
|
||||
|
||||
// Merge the included Taskfile into the parent Taskfile
|
||||
if err := vertex.Taskfile.Merge(
|
||||
includedVertex.Taskfile,
|
||||
include,
|
||||
); err != nil {
|
||||
return err
|
||||
// Merge the included Taskfiles into the parent Taskfile
|
||||
for _, include := range includes {
|
||||
if err := vertex.Taskfile.Merge(
|
||||
includedVertex.Taskfile,
|
||||
include,
|
||||
); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user