Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions taskfile/ast/taskfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ func (t1 *Taskfile) Merge(t2 *Taskfile, include *Include) error {
}
t1.Vars.Merge(t2.Vars, include)
t1.Env.Merge(t2.Env, include)
if t2.Run != "" {
// Apply t2.Run to all t2.Tasks (if not explicitly set). This
// ensures the global `Run` of the imported/merged taskfile is
// retained for those tasks.
for _, v := range t2.Tasks.All(nil) {
if v.Run == "" {
v.Run = t2.Run
}
}
}
return t1.Tasks.Merge(t2.Tasks, include, t1.Vars)
}

Expand Down
Loading