working on build scripts
This commit is contained in:
parent
f273ea4f7d
commit
d524732bbb
111 changed files with 3052 additions and 1989 deletions
|
@ -0,0 +1,34 @@
|
|||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Microsoft.DotNet.Cli.Build.Framework
|
||||
{
|
||||
public struct CommandResult
|
||||
{
|
||||
public static readonly CommandResult Empty = new CommandResult();
|
||||
|
||||
public ProcessStartInfo StartInfo { get; }
|
||||
public int ExitCode { get; }
|
||||
public string StdOut { get; }
|
||||
public string StdErr { get; }
|
||||
|
||||
public CommandResult(ProcessStartInfo startInfo, int exitCode, string stdOut, string stdErr)
|
||||
{
|
||||
StartInfo = startInfo;
|
||||
ExitCode = exitCode;
|
||||
StdOut = stdOut;
|
||||
StdErr = stdErr;
|
||||
}
|
||||
|
||||
public void EnsureSuccessful()
|
||||
{
|
||||
if(ExitCode != 0)
|
||||
{
|
||||
throw new BuildFailureException($"Command failed with exit code {ExitCode}: {StartInfo.FileName} {StartInfo.Arguments}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue