Skip to content

Commit 8d62d97

Browse files
dsarnoclaude
andauthored
fix: handle bare Assets/ path in manage_shader (#743)
Trim(/) was stripping the trailing slash before the StartsWith check, so Assets/ became Assets which did not match Assets/. Now handles the bare Assets case explicitly. Co-authored-by: Claude Opus 4.6 <[email protected]>
1 parent 0c0a68d commit 8d62d97

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

MCPForUnity/Editor/Tools/ManageShader.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ public static object HandleCommand(JObject @params)
6767
if (!string.IsNullOrEmpty(relativeDir))
6868
{
6969
relativeDir = AssetPathUtility.NormalizeSeparators(relativeDir).Trim('/');
70-
if (relativeDir.StartsWith("Assets/", StringComparison.OrdinalIgnoreCase))
70+
if (string.Equals(relativeDir, "Assets", StringComparison.OrdinalIgnoreCase))
71+
{
72+
relativeDir = "";
73+
}
74+
else if (relativeDir.StartsWith("Assets/", StringComparison.OrdinalIgnoreCase))
7175
{
7276
relativeDir = relativeDir.Substring("Assets/".Length).TrimStart('/');
7377
}

0 commit comments

Comments
 (0)