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:
parent
2d4ca37226
commit
12c0d18932
@ -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
|
||||
}
|
||||
|
||||
|
3
task.go
3
task.go
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user