1
0
mirror of https://github.com/go-task/task.git synced 2025-02-09 13:47:06 +02:00

fix(precondition): do not print error if context was aborted (#1338)

This commit is contained in:
Marcello Sylvester Bauer 2023-10-07 15:01:57 -07:00 committed by GitHub
parent 5168e54af7
commit d741dfe26d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,9 @@ func (e *Executor) areTaskPreconditionsMet(ctx context.Context, t *taskfile.Task
Env: env.Get(t),
})
if err != nil {
e.Logger.Errf(logger.Magenta, "task: %s\n", p.Msg)
if !errors.Is(err, context.Canceled) {
e.Logger.Errf(logger.Magenta, "task: %s\n", p.Msg)
}
return false, ErrPreconditionFailed
}
}