SPT-AKI-Installer/SPTInstaller/Models/ReadProcessResult.cs

19 lines
610 B
C#
Raw Permalink Normal View History

2023-11-22 09:32:18 -05:00
namespace SPTInstaller.Models;
public class ReadProcessResult : Result
{
public string StdOut { get; }
public string StdErr { get; }
2024-05-01 10:31:55 -04:00
protected ReadProcessResult(string message, bool succeeded, string stdOut = "", string stdErr = "") : base(message,
succeeded)
2023-11-22 09:32:18 -05:00
{
StdOut = stdOut;
StdErr = stdErr;
}
2024-05-01 10:31:55 -04:00
2023-11-22 09:32:18 -05:00
public static ReadProcessResult FromSuccess(string stdOut, string stdErr) =>
new ReadProcessResult("ok", true, stdOut, stdErr);
2024-05-01 10:31:55 -04:00
2023-11-22 09:32:18 -05:00
public new static ReadProcessResult FromError(string message) => new ReadProcessResult(message, false);
}