1
0
mirror of https://github.com/go-task/task.git synced 2025-01-12 04:34:11 +02:00

Move setting of default version to "taskfile" package

This commit is contained in:
Andrey Nering 2018-03-03 18:56:15 -03:00
parent 2d4ca37226
commit 12c0d18932
2 changed files with 1 additions and 3 deletions

View File

@ -9,6 +9,7 @@ type Taskfile struct {
// UnmarshalYAML implements yaml.Unmarshaler interface
func (tf *Taskfile) UnmarshalYAML(unmarshal func(interface{}) error) error {
if err := unmarshal(&tf.Tasks); err == nil {
tf.Version = "1"
return nil
}

View File

@ -78,9 +78,6 @@ func (e *Executor) Run(calls ...taskfile.Call) error {
}
func (e *Executor) setup() error {
if e.Taskfile.Version == "" {
e.Taskfile.Version = "1"
}
v, err := semver.NewVersion(e.Taskfile.Version)
if err != nil {
return fmt.Errorf(`task: could not parse taskfile version "%s": %v`, e.Taskfile.Version, err)