Browse Source

Add EnsureSuccessExitCode for ProcessResult tasks

pull/438/head
ionite34 11 months ago
parent
commit
0bdd46d110
No known key found for this signature in database
GPG Key ID: B3404C5F3827849B
  1. 10
      StabilityMatrix.Core/Processes/ProcessResult.cs

10
StabilityMatrix.Core/Processes/ProcessResult.cs

@ -22,3 +22,13 @@ public readonly record struct ProcessResult
} }
} }
} }
public static class ProcessResultTaskExtensions
{
public static async Task<ProcessResult> EnsureSuccessExitCode(this Task<ProcessResult> task)
{
var result = await task.ConfigureAwait(false);
result.EnsureSuccessExitCode();
return result;
}
}

Loading…
Cancel
Save