Skip to content

Commit

Permalink
fix #2431 and RIDER-104221
Browse files Browse the repository at this point in the history
GitOrigin-RevId: ff0092f28c01ba6c38512b804cef9975f20a71c1
  • Loading branch information
van800 authored and intellij-monorepo-bot committed Feb 18, 2024
1 parent 5819d06 commit cc2a0e8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion unity/PathLocator/PathLocator.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>1.0.8</Version>
<Version>1.0.9</Version>
<authors>JetBrains</authors>
<LangVersion>10</LangVersion>
<PackageId>JetBrains.Rider.PathLocator</PackageId>
Expand Down
28 changes: 14 additions & 14 deletions unity/PathLocator/RiderPathLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public RiderInfo[] GetAllRiderPaths()
private RiderInfo[] CollectAllRiderPathsLinux()
{
var installInfos = new List<RiderInfo>();
var appsPath = GetAppsRootPathInToolbox();
var appsPath = GetAppsInstallLocation();

installInfos.AddRange(CollectToolbox20Linux(appsPath, "*rider*", "bin/rider.sh"));
installInfos.AddRange(CollectToolbox20Linux(appsPath, "*fleet*", "bin/Fleet"));
Expand Down Expand Up @@ -123,7 +123,7 @@ private RiderInfo[] CollectRiderInfosMac()
installInfos.AddRange(CollectFromApplications("*Rider*.app"));
installInfos.AddRange(CollectFromApplications("*Fleet*.app"));

var appsPath = GetAppsRootPathInToolbox();
var appsPath = GetAppsInstallLocation();
var riderRootPath = Path.Combine(appsPath, "Rider");
installInfos.AddRange(CollectPathsFromToolbox(riderRootPath, "", "Rider*.app", true)
.Select(a => new RiderInfo(this, a, true)));
Expand Down Expand Up @@ -165,7 +165,7 @@ private RiderInfo[] CollectRiderInfosWindows()
{
var installInfos = new List<RiderInfo>();

var appsPath = GetAppsRootPathInToolbox();
var appsPath = GetAppsInstallLocation();
var riderRootPath = Path.Combine(appsPath, "Rider");
installInfos.AddRange(CollectPathsFromToolbox(riderRootPath, "bin", "rider64.exe", false).ToList()
.Select(a => new RiderInfo(this, a, true)).ToList());
Expand Down Expand Up @@ -199,9 +199,18 @@ private void CollectToolbox20(string dir, string pattern, string relPath, List<R
}
}

private string GetAppsRootPathInToolbox()
private string GetAppsInstallLocation()
{
var toolboxPath = GetToolboxPath();
var settingsJson = Path.Combine(toolboxPath, ".settings.json");

if (File.Exists(settingsJson))
{
var path = SettingsJson.GetInstallLocationFromJson(RiderLocatorEnvironment, File.ReadAllText(settingsJson));
if (!string.IsNullOrEmpty(path))
return path;
}

return Path.Combine(toolboxPath, "apps");
}

Expand Down Expand Up @@ -240,15 +249,6 @@ private string GetToolboxPath()
}

var toolboxPath = Path.Combine(localAppData, @"JetBrains/Toolbox");
var settingsJson = Path.Combine(toolboxPath, ".settings.json");

if (File.Exists(settingsJson))
{
var path = SettingsJson.GetInstallLocationFromJson(RiderLocatorEnvironment, File.ReadAllText(settingsJson));
if (!string.IsNullOrEmpty(path))
toolboxPath = path;
}

return toolboxPath;
}

Expand Down Expand Up @@ -306,7 +306,7 @@ private Version GetBuildNumberFromInput(string input)
[UsedImplicitly] // Rider package
public bool GetIsToolbox(string path)
{
return Path.GetFullPath(path).StartsWith(Path.GetFullPath(GetAppsRootPathInToolbox()));
return Path.GetFullPath(path).StartsWith(Path.GetFullPath(GetAppsInstallLocation()));
}

private string GetRelativePathToBuildTxt()
Expand Down

0 comments on commit cc2a0e8

Please sign in to comment.