Skip to content

Commit

Permalink
Fix invalid RID used on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
SaifAqqad committed May 25, 2024
1 parent fb0b363 commit f963011
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/AspireRunner.Core/AspireDashboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public AspireDashboard(DotnetCli dotnetCli, NugetHelper nugetHelper, IOptions<As
Directory.CreateDirectory(_runnerFolder);
}

_nugetPackageName = $"{SdkName}.{RuntimeInformation.RuntimeIdentifier}";
_nugetPackageName = $"{SdkName}.{RuntimeIdentification.Rid}";
}

public async ValueTask StartAsync()
Expand Down
19 changes: 19 additions & 0 deletions src/AspireRunner.Core/Helpers/RuntimeIdentification.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.Runtime.InteropServices;

namespace AspireRunner.Core.Helpers;

public static class RuntimeIdentification
{
public static string OsIdentifier
{
get
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) return "win";
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) return "linux";
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) return "osx";
return "unknown";
}
}

public static string Rid => $"{OsIdentifier}-{RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant()}";
}

0 comments on commit f963011

Please sign in to comment.