Skip to content

Commit 491da0c

Browse files
committed
"ignore_error" is only available on version >= 2.1
1 parent 1bac40b commit 491da0c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

task.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,21 @@ func (e *Executor) Setup() error {
143143
return fmt.Errorf(`task: output option "%s" not recognized`, e.Taskfile.Output)
144144
}
145145

146+
if !version.IsV21(v) {
147+
err := fmt.Errorf(`task: Taskfile option "ignore_error" is only available starting on Taskfile version v2.1`)
148+
149+
for _, task := range e.Taskfile.Tasks {
150+
if task.IgnoreError {
151+
return err
152+
}
153+
for _, cmd := range task.Cmds {
154+
if cmd.IgnoreError {
155+
return err
156+
}
157+
}
158+
}
159+
}
160+
146161
e.taskCallCount = make(map[string]*int32, len(e.Taskfile.Tasks))
147162
for k := range e.Taskfile.Tasks {
148163
e.taskCallCount[k] = new(int32)

0 commit comments

Comments
 (0)