forked from taooceros/Flow.Plugin.VSCodeWorkspace
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSystemPath.cs
More file actions
26 lines (23 loc) · 774 Bytes
/
SystemPath.cs
File metadata and controls
26 lines (23 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Text.RegularExpressions;
namespace Flow.Plugin.CursorWorkspaces
{
internal class SystemPath
{
private static readonly Regex WindowsPath = new Regex(@"^([a-zA-Z]:)", RegexOptions.Compiled);
public static string RealPath(string path)
{
if (WindowsPath.IsMatch(path))
{
string windowsPath = path.Replace("/", "\\");
return $"{windowsPath[0]}".ToUpper() + windowsPath.Remove(0, 1);
}
else
{
return path;
}
}
}
}