Skip to content

Commit 069f1be

Browse files
committed
Fixing so the MCP don't removes _skipDirs e.g. __pycache__
1 parent 68f09e1 commit 069f1be

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

MCPForUnity/Editor/Helpers/ServerInstaller.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,13 @@ private static void CleanupStaleToolFolders(string destToolsDir, HashSet<string>
544544
{
545545
string subdirName = Path.GetFileName(subdir);
546546

547+
// Skip Python cache and virtual environment directories
548+
foreach (var skip in _skipDirs)
549+
{
550+
if (subdirName.Equals(skip, StringComparison.OrdinalIgnoreCase))
551+
goto NextSubdir;
552+
}
553+
547554
// Check if this subdirectory corresponds to an active tools folder
548555
if (!activeFolderIdentifiers.Contains(subdirName))
549556
{
@@ -557,6 +564,7 @@ private static void CleanupStaleToolFolders(string destToolsDir, HashSet<string>
557564
McpLog.Warn($"Failed to delete stale folder {subdirName}: {ex.Message}");
558565
}
559566
}
567+
NextSubdir:;
560568
}
561569
}
562570
catch (Exception ex)

0 commit comments

Comments
 (0)