mirror of
https://github.com/go-task/task.git
synced 2025-07-09 01:17:00 +02:00
v3: Fix bug where global vars were not being considered
This commit is contained in:
@ -41,5 +41,11 @@ func (tf *Taskfile) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
|||||||
if tf.Expansions <= 0 {
|
if tf.Expansions <= 0 {
|
||||||
tf.Expansions = 2
|
tf.Expansions = 2
|
||||||
}
|
}
|
||||||
|
if tf.Vars == nil {
|
||||||
|
tf.Vars = &Vars{}
|
||||||
|
}
|
||||||
|
if tf.Env == nil {
|
||||||
|
tf.Env = &Vars{}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -50,9 +50,6 @@ func (vs *Vars) Merge(other *Vars) {
|
|||||||
|
|
||||||
// Set sets a value to a given key
|
// Set sets a value to a given key
|
||||||
func (vs *Vars) Set(key string, value Var) {
|
func (vs *Vars) Set(key string, value Var) {
|
||||||
if vs == nil {
|
|
||||||
vs = &Vars{}
|
|
||||||
}
|
|
||||||
if vs.Mapping == nil {
|
if vs.Mapping == nil {
|
||||||
vs.Mapping = make(map[string]Var, 1)
|
vs.Mapping = make(map[string]Var, 1)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user