Throw if packing fails

This commit is contained in:
Nate McMaster 2016-11-17 15:47:10 -08:00
parent c8870a80a7
commit 192134cad8
No known key found for this signature in database
GPG Key ID: BD729980AA6A21BD
1 changed files with 7 additions and 1 deletions

View File

@ -136,7 +136,13 @@ namespace NuGetPackager
Console.WriteLine("command: ".Bold().Blue() + pInfo.FileName);
Console.WriteLine("arguments: ".Bold().Blue() + pInfo.Arguments);
Process.Start(pInfo).WaitForExit();
var process = Process.Start(pInfo);
process.WaitForExit();
if (process.ExitCode != 0)
{
throw new InvalidOperationException("NuGet exited with non-zero code " + process.ExitCode);
}
}
private async Task<string> GetNugetExePath()