Skip to content

Commit 83dc0a2

Browse files
committed
RunCommand: escape command and arguments where applicable (henon#59)
1 parent 18503ae commit 83dc0a2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Python.Deployment/Installer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public static async Task PipInstallWheel(Assembly assembly, string resource_name
244244

245245
await TryInstallPip();
246246

247-
RunCommand($"{pipPath} install {wheelPath}");
247+
RunCommand($"\"{pipPath}\" install \"{wheelPath}\"");
248248
}
249249

250250
private static void CopyEmbeddedResourceToFile(Assembly assembly, string resourceName, string filePath, bool force = false)
@@ -301,7 +301,7 @@ public static async Task PipInstallModule(string module_name, string version = "
301301
if (version.Length > 0)
302302
version = $"=={version}";
303303

304-
RunCommand($"{pipPath} install {module_name}{version} {forceInstall}");
304+
RunCommand($"\"{pipPath}\" install \"{module_name}{version}\" {forceInstall}");
305305
}
306306

307307
/// <summary>
@@ -338,7 +338,7 @@ public static async Task InstallPip()
338338
}
339339

340340

341-
RunCommand($"cd {EmbeddedPythonHome} && python.exe Lib\\get-pip.py");
341+
RunCommand($"cd \"{EmbeddedPythonHome}\" && python.exe Lib\\get-pip.py");
342342
}
343343

344344
public static async Task<bool> TryInstallPip(bool force = false)

0 commit comments

Comments
 (0)