1
0
mirror of https://github.com/go-task/task.git synced 2025-11-06 09:09:13 +02:00

Allow global variables in the Taskfile

Closes #66
This commit is contained in:
Andrey Nering
2018-03-04 15:39:14 -03:00
parent 975f262ac0
commit 1a3df08aca
6 changed files with 23 additions and 9 deletions

View File

@@ -3,6 +3,7 @@ package taskfile
// Taskfile represents a Taskfile.yml
type Taskfile struct {
Version string
Vars Vars
Tasks Tasks
}
@@ -15,12 +16,14 @@ func (tf *Taskfile) UnmarshalYAML(unmarshal func(interface{}) error) error {
var taskfile struct {
Version string
Vars Vars
Tasks Tasks
}
if err := unmarshal(&taskfile); err != nil {
return err
}
tf.Version = taskfile.Version
tf.Vars = taskfile.Vars
tf.Tasks = taskfile.Tasks
return nil
}