Merge branch 'GoaLitiuM-dotnet_sdk_detect_fix'
This commit is contained in:
@@ -235,8 +235,8 @@ namespace Flax.Build
|
|||||||
ridFallback = "";
|
ridFallback = "";
|
||||||
if (string.IsNullOrEmpty(dotnetPath))
|
if (string.IsNullOrEmpty(dotnetPath))
|
||||||
{
|
{
|
||||||
dotnetPath = "/usr/local/share/dotnet/";
|
dotnetPath = "/usr/local/share/dotnet/"; // Officially recommended dotnet location
|
||||||
if (!Directory.Exists(dotnetPath)) // Officially recommended dotnet location
|
if (!Directory.Exists(dotnetPath))
|
||||||
{
|
{
|
||||||
if (Environment.GetEnvironmentVariable("PATH") is string globalBinPath)
|
if (Environment.GetEnvironmentVariable("PATH") is string globalBinPath)
|
||||||
dotnetPath = globalBinPath.Split(':').FirstOrDefault(x => File.Exists(Path.Combine(x, "dotnet")));
|
dotnetPath = globalBinPath.Split(':').FirstOrDefault(x => File.Exists(Path.Combine(x, "dotnet")));
|
||||||
@@ -261,7 +261,7 @@ namespace Flax.Build
|
|||||||
Log.Warning("Missing .NET SDK");
|
Log.Warning("Missing .NET SDK");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!Directory.Exists(dotnetPath))
|
if (!Directory.Exists(Path.Combine(dotnetPath, "sdk")))
|
||||||
{
|
{
|
||||||
Log.Warning($"Missing .NET SDK ({dotnetPath})");
|
Log.Warning($"Missing .NET SDK ({dotnetPath})");
|
||||||
return;
|
return;
|
||||||
@@ -513,6 +513,8 @@ namespace Flax.Build
|
|||||||
|
|
||||||
private static IEnumerable<string> GetVersions(string folder)
|
private static IEnumerable<string> GetVersions(string folder)
|
||||||
{
|
{
|
||||||
|
if (!Directory.Exists(folder))
|
||||||
|
return Enumerable.Empty<string>();
|
||||||
return Directory.GetDirectories(folder).Select(Path.GetFileName);
|
return Directory.GetDirectories(folder).Select(Path.GetFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user