Browse Source

Only use copy mode in windows

pull/55/head
Ionite 1 year ago
parent
commit
9743688c69
No known key found for this signature in database
  1. 4
      StabilityMatrix.Core/Processes/ProcessRunner.cs
  2. 5
      StabilityMatrix.Core/Python/PyVenvRunner.cs

4
StabilityMatrix.Core/Processes/ProcessRunner.cs

@ -125,7 +125,9 @@ public static class ProcessRunner
Dictionary<string, string>? 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);
}

5
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();

Loading…
Cancel
Save