Summary
Adds a criteria that has to be fulfilled for the task to run.
The criteria is evaluated when traversal of the graph occurs.
Syntax
public static CakeTaskBuilder WithCriteria(this CakeTaskBuilder builder, Func<ICakeContext, bool> criteria, string message)
Examples
Task("Publish")
.WithCriteria(context => context.FileSystem.Exist("./publish.enabled"), "Publish not enabled")
.Does(() => { });
Parameters
| Name |
Type |
Description |
| builder |
CakeTaskBuilder |
The task builder. |
| criteria |
Func<ICakeContext, bool> |
The criteria. |
| message |
string |
The message to display if the task was skipped due to the provided criteria. |
Return Value