Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion MCPForUnity/Editor/Tools/ManageScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,17 @@ private static bool TryResolveUnderAssets(string relDir, out string fullPathDir,
// Normalize caller path: allow both "Scripts/..." and "Assets/Scripts/..."
string rel = (relDir ?? "Scripts").Replace('\\', '/').Trim();
if (string.IsNullOrEmpty(rel)) rel = "Scripts";
if (rel.StartsWith("Assets/", StringComparison.OrdinalIgnoreCase)) rel = rel.Substring(7);

// Handle both "Assets" and "Assets/" prefixes
if (rel.Equals("Assets", StringComparison.OrdinalIgnoreCase))
{
rel = string.Empty;
}
else if (rel.StartsWith("Assets/", StringComparison.OrdinalIgnoreCase))
{
rel = rel.Substring(7);
}

rel = rel.TrimStart('/');

string targetDir = Path.Combine(assets, rel).Replace('\\', '/');
Expand Down
2 changes: 1 addition & 1 deletion Server/src/services/tools/manage_asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async def _normalize_properties(raw: dict[str, Any] | str | None) -> tuple[dict[

properties, parse_error = await _normalize_properties(properties)
if parse_error:
await ctx.warn(parse_error)
await ctx.error(parse_error)
return {"success": False, "message": parse_error}

# Coerce numeric inputs defensively
Expand Down