Skip to content

Commit 4314e2a

Browse files
committed
refactor: remove duplicate UV validation code from platform detectors
1 parent 3d107e5 commit 4314e2a

File tree

3 files changed

+0
-108
lines changed

3 files changed

+0
-108
lines changed

UnityMcpBridge/Editor/Dependencies/PlatformDetectors/LinuxPlatformDetector.cs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -159,42 +159,6 @@ private bool TryValidatePython(string pythonPath, out string version, out string
159159
return false;
160160
}
161161

162-
private bool TryValidateUV(string uvPath, out string version)
163-
{
164-
version = null;
165-
166-
try
167-
{
168-
var psi = new ProcessStartInfo
169-
{
170-
FileName = uvPath,
171-
Arguments = "--version",
172-
UseShellExecute = false,
173-
RedirectStandardOutput = true,
174-
RedirectStandardError = true,
175-
CreateNoWindow = true
176-
};
177-
178-
using var process = Process.Start(psi);
179-
if (process == null) return false;
180-
181-
string output = process.StandardOutput.ReadToEnd().Trim();
182-
process.WaitForExit(5000);
183-
184-
if (process.ExitCode == 0 && output.StartsWith("uv "))
185-
{
186-
version = output.Substring(3); // Remove "uv " prefix
187-
return true;
188-
}
189-
}
190-
catch
191-
{
192-
// Ignore validation errors
193-
}
194-
195-
return false;
196-
}
197-
198162
private bool TryFindInPath(string executable, out string fullPath)
199163
{
200164
fullPath = null;

UnityMcpBridge/Editor/Dependencies/PlatformDetectors/MacOSPlatformDetector.cs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -159,42 +159,6 @@ private bool TryValidatePython(string pythonPath, out string version, out string
159159
return false;
160160
}
161161

162-
private bool TryValidateUV(string uvPath, out string version)
163-
{
164-
version = null;
165-
166-
try
167-
{
168-
var psi = new ProcessStartInfo
169-
{
170-
FileName = uvPath,
171-
Arguments = "--version",
172-
UseShellExecute = false,
173-
RedirectStandardOutput = true,
174-
RedirectStandardError = true,
175-
CreateNoWindow = true
176-
};
177-
178-
using var process = Process.Start(psi);
179-
if (process == null) return false;
180-
181-
string output = process.StandardOutput.ReadToEnd().Trim();
182-
process.WaitForExit(5000);
183-
184-
if (process.ExitCode == 0 && output.StartsWith("uv "))
185-
{
186-
version = output.Substring(3); // Remove "uv " prefix
187-
return true;
188-
}
189-
}
190-
catch
191-
{
192-
// Ignore validation errors
193-
}
194-
195-
return false;
196-
}
197-
198162
private bool TryFindInPath(string executable, out string fullPath)
199163
{
200164
fullPath = null;

UnityMcpBridge/Editor/Dependencies/PlatformDetectors/WindowsPlatformDetector.cs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -147,42 +147,6 @@ private bool TryValidatePython(string pythonPath, out string version, out string
147147
return false;
148148
}
149149

150-
private bool TryValidateUV(string uvPath, out string version)
151-
{
152-
version = null;
153-
154-
try
155-
{
156-
var psi = new ProcessStartInfo
157-
{
158-
FileName = uvPath,
159-
Arguments = "--version",
160-
UseShellExecute = false,
161-
RedirectStandardOutput = true,
162-
RedirectStandardError = true,
163-
CreateNoWindow = true
164-
};
165-
166-
using var process = Process.Start(psi);
167-
if (process == null) return false;
168-
169-
string output = process.StandardOutput.ReadToEnd().Trim();
170-
process.WaitForExit(5000);
171-
172-
if (process.ExitCode == 0 && output.StartsWith("uv "))
173-
{
174-
version = output.Substring(3); // Remove "uv " prefix
175-
return true;
176-
}
177-
}
178-
catch
179-
{
180-
// Ignore validation errors
181-
}
182-
183-
return false;
184-
}
185-
186150
private bool TryFindInPath(string executable, out string fullPath)
187151
{
188152
fullPath = null;

0 commit comments

Comments
 (0)