Skip to content

Commit

Permalink
Change assertions in ProcessExtensions to have IProcess as return value.
Browse files Browse the repository at this point in the history
  • Loading branch information
arodus authored and matkoch committed Feb 17, 2018
1 parent 463e8da commit 14beed6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/Nuke.Core/Tooling/ProcessExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ namespace Nuke.Core.Tooling
public static class ProcessExtensions
{
[AssertionMethod]
public static void AssertWaitForExit(
public static IProcess AssertWaitForExit(
[AssertionCondition(AssertionConditionType.IS_NOT_NULL)] [CanBeNull]
this IProcess process)
{
ControlFlow.Assert(process != null && process.WaitForExit(), "process != null && process.WaitForExit()");
return process;
}

[AssertionMethod]
public static void AssertZeroExitCode(
public static IProcess AssertZeroExitCode(
[AssertionCondition(AssertionConditionType.IS_NOT_NULL)] [CanBeNull]
this IProcess process)
{
Expand All @@ -37,6 +38,7 @@ public static void AssertZeroExitCode(
$"Process '{Path.GetFileName(process.FileName)}' exited with code {process.ExitCode}. Please verify the invocation.",
$"> {process.FileName.DoubleQuoteIfNeeded()} {process.Arguments}"
}.JoinNewLine());
return process;
}

public static IEnumerable<Output> EnsureOnlyStd(this IEnumerable<Output> output)
Expand Down

0 comments on commit 14beed6

Please sign in to comment.