Skip to content

Commit a994e72

Browse files
Add the home dir command to the preprocessor
1 parent 1f4c3b4 commit a994e72

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

mcp_nexus/Utilities/CommandPreprocessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ private static bool ShouldSkipSymbolPathToken(string token)
179179
return false;
180180
}
181181

182-
[GeneratedRegex(@"/mnt/[a-zA-Z]/[^\s;""]+", RegexOptions.Compiled)]
182+
[GeneratedRegex(@"/mnt/[^/\s;""]+/[^\s;""]*", RegexOptions.Compiled)]
183183
private static partial Regex MyRegex();
184184
}
185185
}

mcp_nexus_tests/Mocks/MockWslPathConverter.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,15 @@ public bool TryConvertToWindowsPath(string wslPath, out string windowsPath)
4242
public Dictionary<string, string> LoadFstabMappings()
4343
{
4444
// Return standard /mnt/c -> C:\ and /mnt/d -> D:\ mappings
45+
// Also include multi-character mount points for testing
4546
return new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
4647
{
4748
{ "/mnt/c", "C:\\" },
4849
{ "/mnt/d", "D:\\" },
4950
{ "/mnt/e", "E:\\" },
50-
{ "/mnt/f", "F:\\" }
51+
{ "/mnt/f", "F:\\" },
52+
{ "/mnt/analysis", "C:\\analysis" },
53+
{ "/mnt/share", "C:\\share" }
5154
};
5255
}
5356
}

mcp_nexus_tests/Utilities/CommandPreprocessorTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,9 @@ public void PreprocessCommand_WithExistingDirectory_DoesNotFail()
205205
[InlineData("!homedir C:\\my\\home\\dir", "!homedir C:\\my\\home\\dir")]
206206
[InlineData("!homedir \"C:\\my\\home\\dir\"", "!homedir \"C:\\my\\home\\dir\"")]
207207
[InlineData("!homedir /mnt/c/my/home/dir", "!homedir C:\\my\\home\\dir")]
208+
[InlineData("!homedir /mnt/analysis/test-path", "!homedir C:\\analysis\\test-path")]
209+
[InlineData("!homedir /mnt/share/folder", "!homedir C:\\share\\folder")]
210+
[InlineData("!homedir \"/mnt/share/folder\"", "!homedir \"C:\\share\\folder\"")]
208211
[InlineData("!HOMEDIR C:\\test", "!HOMEDIR C:\\test")]
209212
public void PreprocessCommand_Homedir_ConvertsWslPaths(string input, string expected)
210213
{

0 commit comments

Comments
 (0)