mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-08 23:41:57 +02:00
Add CLI process and GUI start/stop commands with process management
This commit is contained in:
@@ -11,6 +11,18 @@ public class StartGuiCommand : ICommand
|
||||
public void Execute(string? arguments, Action<string> printLine)
|
||||
{
|
||||
printLine("Starting Desktop Process...");
|
||||
|
||||
if (ProcessManager.IsProcessRunning<DesktopProcess>())
|
||||
{
|
||||
printLine("Desktop Process is already running.");
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (Process process in ProcessManager.GetProcessesOfType<CliProcess>())
|
||||
{
|
||||
ProcessManager.StopProcess(process.Id);
|
||||
}
|
||||
|
||||
_ = ProcessManager.SpawnProcess<DesktopProcess>();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user