mirror of
https://github.com/go-task/task.git
synced 2025-06-15 00:15:10 +02:00
@ -2,9 +2,10 @@ package taskfile
|
||||
|
||||
// Taskfile represents a Taskfile.yml
|
||||
type Taskfile struct {
|
||||
Version string
|
||||
Vars Vars
|
||||
Tasks Tasks
|
||||
Version string
|
||||
Expansions int
|
||||
Vars Vars
|
||||
Tasks Tasks
|
||||
}
|
||||
|
||||
// UnmarshalYAML implements yaml.Unmarshaler interface
|
||||
@ -15,15 +16,20 @@ func (tf *Taskfile) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||
}
|
||||
|
||||
var taskfile struct {
|
||||
Version string
|
||||
Vars Vars
|
||||
Tasks Tasks
|
||||
Version string
|
||||
Expansions int
|
||||
Vars Vars
|
||||
Tasks Tasks
|
||||
}
|
||||
if err := unmarshal(&taskfile); err != nil {
|
||||
return err
|
||||
}
|
||||
tf.Version = taskfile.Version
|
||||
tf.Expansions = taskfile.Expansions
|
||||
tf.Vars = taskfile.Vars
|
||||
tf.Tasks = taskfile.Tasks
|
||||
if tf.Expansions <= 0 {
|
||||
tf.Expansions = 2
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user