diff --git a/task.go b/task.go index 8d90a1da..b4b9105b 100644 --- a/task.go +++ b/task.go @@ -227,6 +227,9 @@ func (e *Executor) Setup() error { } } + if v < 3 && e.Taskfile.Run != "" { + return errors.New(`task: Setting the "run" type is only available starting on Taskfile version v3`) + } if e.Taskfile.Run == "" { e.Taskfile.Run = "always" } @@ -264,6 +267,11 @@ func (e *Executor) Setup() error { if err != nil { return err } + for _, task := range e.Taskfile.Tasks { + if task.Run != "" { + return errors.New(`task: Setting the "run" type is only available starting on Taskfile version v3`) + } + } } e.execution = make(map[string]context.Context)