diff --git a/Castor/Castor.csproj b/Castor/Castor.csproj index 7471835..1ae40a0 100644 --- a/Castor/Castor.csproj +++ b/Castor/Castor.csproj @@ -6,7 +6,7 @@ castor-icon.ico ZtModArchive MIT License - 3.1.0 + 3.2.0 https://github.com/ZtModArchive/Castor/tree/main/Castor castor-icon.ico diff --git a/Castor/Services/CommandService.cs b/Castor/Services/CommandService.cs index 65e9d07..efbdd4e 100644 --- a/Castor/Services/CommandService.cs +++ b/Castor/Services/CommandService.cs @@ -194,12 +194,16 @@ public void ConsoleCommand(string program, string arg) process.StartInfo.UseShellExecute = false; process.Start(); - while (!process.StandardOutput.EndOfStream) + using (StreamWriter writer = new StreamWriter("castorlog.txt")) { - string line = process.StandardOutput.ReadLine(); - Console.WriteLine(line); - // do something with line + while (!process.StandardOutput.EndOfStream) + { + string line = process.StandardOutput.ReadLine(); + Console.WriteLine($"{line}"); + writer.WriteLine($"{line}"); + } } + process.WaitForExit(); } }