diff --git a/StabilityMatrix.Core/Processes/ProcessRunner.cs b/StabilityMatrix.Core/Processes/ProcessRunner.cs index 5a9e5191..99edcf7e 100644 --- a/StabilityMatrix.Core/Processes/ProcessRunner.cs +++ b/StabilityMatrix.Core/Processes/ProcessRunner.cs @@ -125,7 +125,9 @@ public static class ProcessRunner Dictionary? environmentVariables = null) { // Quote arguments containing spaces - var args = string.Join(" ", arguments.Select(Quote)); + var args = string.Join(" ", arguments + .Where(s => !string.IsNullOrEmpty(s)) + .Select(Quote)); return StartProcess(fileName, args, workingDirectory, outputDataReceived, environmentVariables); } diff --git a/StabilityMatrix.Core/Python/PyVenvRunner.cs b/StabilityMatrix.Core/Python/PyVenvRunner.cs index 1297135e..c9dce51e 100644 --- a/StabilityMatrix.Core/Python/PyVenvRunner.cs +++ b/StabilityMatrix.Core/Python/PyVenvRunner.cs @@ -93,8 +93,9 @@ public class PyVenvRunner : IDisposable // Create RootPath if it doesn't exist RootPath.Create(); - // Create venv - var args = new string[] { "-m", "virtualenv", "--always-copy", RootPath }; + // Create venv (copy mode if windows) + var args = new string[] { "-m", "virtualenv", + Compat.IsWindows ? "--always-copy" : "", RootPath }; var venvProc = ProcessRunner.StartProcess(PyRunner.PythonExePath, args); await venvProc.WaitForExitAsync();