Skip to content

Commit cbb12b2

Browse files
committed
v3: Fix bug where global vars were not being considered
1 parent 6ed30f1 commit cbb12b2

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

internal/taskfile/taskfile.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,11 @@ func (tf *Taskfile) UnmarshalYAML(unmarshal func(interface{}) error) error {
4141
if tf.Expansions <= 0 {
4242
tf.Expansions = 2
4343
}
44+
if tf.Vars == nil {
45+
tf.Vars = &Vars{}
46+
}
47+
if tf.Env == nil {
48+
tf.Env = &Vars{}
49+
}
4450
return nil
4551
}

internal/taskfile/var.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ func (vs *Vars) Merge(other *Vars) {
5050

5151
// Set sets a value to a given key
5252
func (vs *Vars) Set(key string, value Var) {
53-
if vs == nil {
54-
vs = &Vars{}
55-
}
5653
if vs.Mapping == nil {
5754
vs.Mapping = make(map[string]Var, 1)
5855
}

0 commit comments

Comments
 (0)