Files
octokit.net/build/Tasks/FormatCode.cs
T
Brendan Forster 56895ea621 move formatting code to optional flag (#2085)
* move formatting code to flag

* reformat code
2020-02-06 10:48:38 -04:00

21 lines
491 B
C#

using System;
using Cake.Common;
using Cake.Frosting;
public sealed class FormatCode : FrostingTask<Context>
{
public override void Run(Context context)
{
int result = context.StartProcess(context.DotNetFormatToolPath);
if (result != 0)
{
throw new Exception($"Failed to execute {context.DotNetFormatToolPath} ({result})");
}
}
public override bool ShouldRun(Context context)
{
return context.FormatCode;
}
}