1
0
mirror of https://github.com/go-task/task.git synced 2025-08-10 22:42:19 +02:00

Merge global environment variables when merging tasks

This commit is contained in:
Andrey Nering
2019-01-02 13:20:12 -02:00
parent aac6c5a1c7
commit 4ddad68212

View File

@@ -35,6 +35,13 @@ func Merge(t1, t2 *Taskfile, namespaces ...string) error {
t1.Vars[k] = v t1.Vars[k] = v
} }
if t1.Env == nil {
t1.Env = make(Vars)
}
for k, v := range t2.Vars {
t1.Env[k] = v
}
if t1.Tasks == nil { if t1.Tasks == nil {
t1.Tasks = make(Tasks) t1.Tasks = make(Tasks)
} }