From 491da0ceb969dff915e1df77af93241de2c69c7c Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Sun, 19 Aug 2018 15:46:07 -0300 Subject: [PATCH] "ignore_error" is only available on version >= 2.1 --- task.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/task.go b/task.go index 71c7644f..ce4d2d1d 100644 --- a/task.go +++ b/task.go @@ -143,6 +143,21 @@ func (e *Executor) Setup() error { return fmt.Errorf(`task: output option "%s" not recognized`, e.Taskfile.Output) } + if !version.IsV21(v) { + err := fmt.Errorf(`task: Taskfile option "ignore_error" is only available starting on Taskfile version v2.1`) + + for _, task := range e.Taskfile.Tasks { + if task.IgnoreError { + return err + } + for _, cmd := range task.Cmds { + if cmd.IgnoreError { + return err + } + } + } + } + e.taskCallCount = make(map[string]*int32, len(e.Taskfile.Tasks)) for k := range e.Taskfile.Tasks { e.taskCallCount[k] = new(int32)