mirror of
https://github.com/go-task/task.git
synced 2025-06-06 23:46:46 +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
|
// UnmarshalYAML implements yaml.Unmarshaler interface
|
||||||
func (tf *Taskfile) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
func (tf *Taskfile) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||||
if err := unmarshal(&tf.Tasks); err == nil {
|
if err := unmarshal(&tf.Tasks); err == nil {
|
||||||
|
tf.Version = "1"
|
||||||
return nil
|
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 {
|
func (e *Executor) setup() error {
|
||||||
if e.Taskfile.Version == "" {
|
|
||||||
e.Taskfile.Version = "1"
|
|
||||||
}
|
|
||||||
v, err := semver.NewVersion(e.Taskfile.Version)
|
v, err := semver.NewVersion(e.Taskfile.Version)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf(`task: could not parse taskfile version "%s": %v`, e.Taskfile.Version, err)
|
return fmt.Errorf(`task: could not parse taskfile version "%s": %v`, e.Taskfile.Version, err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user