From bbe1d8b52ec1f6ea6a2788387a37b9ace874d8c0 Mon Sep 17 00:00:00 2001 From: Ross Hammermeister Date: Wed, 26 Aug 2020 11:10:27 -0600 Subject: [PATCH] Adding proper version checking for taskfile when using run --- task.go | 8 ++++++++ 1 file changed, 8 insertions(+) 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)