mirror of
https://github.com/go-task/task.git
synced 2026-07-02 17:08:45 +00:00
Refactor variables: Keep order of declaration
This shouldn't have any behavior changes for now. This is a code refactor that should allow us to do further improvements on how variables are handled, specially regarding respecting the declaration order in Taskfiles, which should make it easier for the users. Initial work on #218
This commit is contained in:
@@ -7,8 +7,8 @@ type Taskfile struct {
|
||||
Output string
|
||||
Method string
|
||||
Includes IncludedTaskfiles
|
||||
Vars Vars
|
||||
Env Vars
|
||||
Vars *Vars
|
||||
Env *Vars
|
||||
Tasks Tasks
|
||||
Silent bool
|
||||
}
|
||||
@@ -21,8 +21,8 @@ func (tf *Taskfile) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||
Output string
|
||||
Method string
|
||||
Includes IncludedTaskfiles
|
||||
Vars Vars
|
||||
Env Vars
|
||||
Vars *Vars
|
||||
Env *Vars
|
||||
Tasks Tasks
|
||||
Silent bool
|
||||
}
|
||||
@@ -41,8 +41,5 @@ func (tf *Taskfile) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||
if tf.Expansions <= 0 {
|
||||
tf.Expansions = 2
|
||||
}
|
||||
if tf.Vars == nil {
|
||||
tf.Vars = make(Vars)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user