File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
UnityMcpBridge/Editor/Helpers Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -328,6 +328,22 @@ internal static string FindUvPath()
328328 RedirectStandardError = true ,
329329 CreateNoWindow = true
330330 } ;
331+ try
332+ {
333+ // Prepend common user-local and package manager locations so 'which' can see them in Unity's GUI env
334+ string homeDir = Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) ?? string . Empty ;
335+ string prepend = string . Join ( ":" , new [ ]
336+ {
337+ System . IO . Path . Combine ( homeDir , ".local" , "bin" ) ,
338+ "/opt/homebrew/bin" ,
339+ "/usr/local/bin" ,
340+ "/usr/bin" ,
341+ "/bin"
342+ } ) ;
343+ string currentPath = Environment . GetEnvironmentVariable ( "PATH" ) ?? string . Empty ;
344+ whichPsi . Environment [ "PATH" ] = string . IsNullOrEmpty ( currentPath ) ? prepend : ( prepend + ":" + currentPath ) ;
345+ }
346+ catch { }
331347 using var wp = System . Diagnostics . Process . Start ( whichPsi ) ;
332348 string output = wp . StandardOutput . ReadToEnd ( ) . Trim ( ) ;
333349 wp . WaitForExit ( 3000 ) ;
You can’t perform that action at this time.
0 commit comments