in Source/RiderSourceCodeAccess/Private/RiderPathLocator/Mac/RiderPathLocatorMac.cpp [71:108]
static TArray<FInstallInfo> GetInstalledRidersWithMdfind()
{
int32 ReturnCode;
FString OutResults;
FString OutErrors;
// avoid trying to run mdfind if it doesnt exists
if (!FPaths::FileExists(TEXT("/usr/bin/mdfind")))
{
return {};
}
FPlatformProcess::ExecProcess(TEXT("/usr/bin/mdfind"), TEXT("\"kMDItemKind == Application\""), &ReturnCode, &OutResults, &OutErrors);
if (ReturnCode != 0)
{
return {};
}
TArray<FString> RiderPaths;
FString TmpString;
while(OutResults.Split(TEXT("\n"), &TmpString, &OutResults))
{
if(TmpString.Contains(TEXT("Rider")))
{
RiderPaths.Add(TmpString);
}
}
TArray<FInstallInfo> Result;
for(const FString& RiderPath: RiderPaths)
{
TOptional<FInstallInfo> InstallInfo = FRiderPathLocator::GetInstallInfoFromRiderPath(RiderPath, FInstallInfo::EInstallType::Installed);
if(InstallInfo.IsSet())
{
Result.Add(InstallInfo.GetValue());
}
}
return Result;
}