Finished compile time plugin loading. Refactored plugin loading. Extended build helper script

This commit is contained in:
2025-05-13 20:48:50 +02:00
parent 8126250d1a
commit a579dd4759
28 changed files with 1169 additions and 741 deletions

View File

@@ -0,0 +1,30 @@
using System.Diagnostics;
namespace Scripts.Helpers;
public class CommandHelper
{
public async Task Run(string program, string arguments, string? workingDir = null)
{
var process = await RunRaw(program, arguments, workingDir);
await process.WaitForExitAsync();
if (process.ExitCode != 0)
throw new Exception($"The command '{program} {arguments}' failed with exit code: {process.ExitCode}");
}
private Task<Process> RunRaw(string program, string arguments, string? workingDir = null)
{
var psi = new ProcessStartInfo()
{
FileName = program,
Arguments = arguments,
WorkingDirectory = string.IsNullOrEmpty(workingDir) ? Directory.GetCurrentDirectory() : workingDir
};
var process = Process.Start(psi)!;
return Task.FromResult(process);
}
}