mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 03:37:59 +01:00
[PT Run][VSCodeWorkspaces] Do not check WSL paths existence (#31351)
This commit is contained in:
@@ -46,7 +46,7 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.WorkspacesHelper
|
|||||||
path = path[1..];
|
path = path[1..];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DoesPathExist(path, workspaceEnv.Value, machineName))
|
if (!DoesPathExist(path, workspaceEnv.Value))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -72,18 +72,11 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.WorkspacesHelper
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool DoesPathExist(string path, WorkspaceEnvironment workspaceEnv, string machineName)
|
private bool DoesPathExist(string path, WorkspaceEnvironment workspaceEnv)
|
||||||
{
|
{
|
||||||
if (workspaceEnv == WorkspaceEnvironment.Local || workspaceEnv == WorkspaceEnvironment.RemoteWSL)
|
if (workspaceEnv == WorkspaceEnvironment.Local)
|
||||||
{
|
{
|
||||||
var resolvedPath = path;
|
return Directory.Exists(path) || File.Exists(path);
|
||||||
|
|
||||||
if (workspaceEnv == WorkspaceEnvironment.RemoteWSL)
|
|
||||||
{
|
|
||||||
resolvedPath = $"\\\\wsl$\\{machineName}{resolvedPath.Replace('/', '\\')}";
|
|
||||||
}
|
|
||||||
|
|
||||||
return Directory.Exists(resolvedPath) || File.Exists(resolvedPath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the workspace environment is not Local or WSL, assume the path exists
|
// If the workspace environment is not Local or WSL, assume the path exists
|
||||||
|
|||||||
Reference in New Issue
Block a user