diff --git a/src/Artemis.UI.Linux/ApplicationStateManager.cs b/src/Artemis.UI.Linux/ApplicationStateManager.cs index dd4ae179a..41b999a65 100644 --- a/src/Artemis.UI.Linux/ApplicationStateManager.cs +++ b/src/Artemis.UI.Linux/ApplicationStateManager.cs @@ -154,18 +154,16 @@ public class ApplicationStateManager RunScriptWithOutputFile(script, $"{source} {destination} {args}", Path.Combine(Constants.DataFolder, "update-log.txt")); - // Lets try a graceful shutdown, PowerShell will kill if needed + // Lets try a graceful shutdown, the script will kill if needed if (Application.Current?.ApplicationLifetime is IControlledApplicationLifetime controlledApplicationLifetime) Dispatcher.UIThread.Post(() => controlledApplicationLifetime.Shutdown()); } - private void RunScriptWithOutputFile(string script, string arguments, string outputFile) + private static void RunScriptWithOutputFile(string script, string arguments, string outputFile) { - // Use > for files that are bigger than 200kb to start fresh, otherwise use >> to append - string redirectSymbol = File.Exists(outputFile) && new FileInfo(outputFile).Length > 200000 ? ">" : ">>"; ProcessStartInfo info = new() { - Arguments = $"\"{script}\" {arguments} {redirectSymbol} \"{outputFile}\"", + Arguments = $"\"{script}\" {arguments} > \"{outputFile}\"", FileName = "/bin/bash", WindowStyle = ProcessWindowStyle.Hidden, CreateNoWindow = true,