TArray FRiderPathLocator::GetInstallInfos()

in Source/RiderSourceCodeAccess/Private/RiderPathLocator/Common/RiderPathLocator.cpp [105:124]


TArray<FInstallInfo> FRiderPathLocator::GetInstallInfos(const FString& ToolboxRiderRootPath, const FString& Pattern, FInstallInfo::EInstallType InstallType)
{
	if(!DirectoryExistsAndNonEmpty(ToolboxRiderRootPath)) return {};
	
	TArray<FInstallInfo> RiderInstallInfos;
	TArray<FString> RiderPaths;
	IFileManager::Get().FindFilesRecursive(RiderPaths, *ToolboxRiderRootPath, *Pattern, true, true);
	for(const FString& RiderPath: RiderPaths)
	{
		TOptional<FInstallInfo> InstallInfo = GetInstallInfoFromRiderPath(RiderPath, InstallType);
		if(!InstallInfo.IsSet()) continue;
		
		FString HistoryJsonPath = GetHistoryJsonPath(RiderPath);
		FVersion Version = GetLastBuildVersion(HistoryJsonPath);
		if(Version.IsInitialized() && InstallInfo->Version != Version) continue;
		
		RiderInstallInfos.Add(InstallInfo.GetValue());
	}
	return RiderInstallInfos;
}