From 33b6486b707a9835cde6668f53bb961a822db764 Mon Sep 17 00:00:00 2001 From: Justin Barnett Date: Tue, 8 Apr 2025 10:39:14 -0400 Subject: [PATCH] backslashes for windows --- .../Editor/Helpers/ServerInstaller.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/UnityMcpBridge/Editor/Helpers/ServerInstaller.cs b/UnityMcpBridge/Editor/Helpers/ServerInstaller.cs index 304629a..e20996c 100644 --- a/UnityMcpBridge/Editor/Helpers/ServerInstaller.cs +++ b/UnityMcpBridge/Editor/Helpers/ServerInstaller.cs @@ -127,12 +127,25 @@ namespace UnityMcpBridge.Editor.Helpers // Clone the repository RunCommand("git", $"clone -b {BranchName} {GitUrl} \"{location}\""); - // Set up virtual environment and install dependencies + // Set up virtual environment string venvPath = Path.Combine(location, "venv"); RunCommand("python", $"-m venv \"{venvPath}\""); + + // Determine the path to the virtual environment's Python interpreter + string pythonPath = Path.Combine( + venvPath, + RuntimeInformation.IsOSPlatform(OSPlatform.Windows) + ? "Scripts\\python.exe" + : "bin/python" + ); + + // Install uv into the virtual environment + RunCommand(pythonPath, "-m pip install uv"); + + // Use uv to install dependencies string uvPath = Path.Combine( venvPath, - RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "Scripts/uv.exe" : "bin/uv" + RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "Scripts\\uv.exe" : "bin/uv" ); RunCommand(uvPath, "install"); }