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

fix: advanced import resolving dynamic variables incorrectly

This commit is contained in:
Pete Davison 2023-09-15 14:56:22 +00:00
parent fb9f6c20ab
commit 1d230af90d

View File

@ -89,16 +89,16 @@ func (tfg *TaskfileGraph) Merge() (*Taskfile, error) {
// Handle advanced imports
// i.e. where additional data is given when a Taskfile is included
if include.AdvancedImport {
predecessorVertex.Taskfile.Vars.Range(func(k string, v Var) error {
vertex.Taskfile.Vars.Range(func(k string, v Var) error {
o := v
o.Dir = include.Dir
predecessorVertex.Taskfile.Vars.Set(k, o)
vertex.Taskfile.Vars.Set(k, o)
return nil
})
predecessorVertex.Taskfile.Env.Range(func(k string, v Var) error {
vertex.Taskfile.Env.Range(func(k string, v Var) error {
o := v
o.Dir = include.Dir
predecessorVertex.Taskfile.Env.Set(k, o)
vertex.Taskfile.Env.Set(k, o)
return nil
})
for _, task := range vertex.Taskfile.Tasks.Values() {