2025-04-14 19:29:56 +02:00
|
|
|
namespace Build.Commands;
|
|
|
|
|
|
|
|
|
|
public sealed class CheckRidsCommand
|
|
|
|
|
{
|
2026-11-04 14:57:37 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Defines the command "check-rids".
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static Command CreateCommand()
|
|
|
|
|
{
|
|
|
|
|
var command = new Command("check-rids", "Check the RIDs for the current OS");
|
|
|
|
|
command.SetAction(_ => new CheckRidsCommand().GetRids());
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-14 19:29:56 +02:00
|
|
|
public void GetRids()
|
|
|
|
|
{
|
|
|
|
|
if(!Environment.IsWorkingDirectoryValid())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
var rids = Environment.GetRidsForCurrentOS();
|
|
|
|
|
Console.WriteLine("The following RIDs are available for the current OS:");
|
|
|
|
|
foreach (var rid in rids)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine($"- {rid}");
|
|
|
|
|
}
|
2025-05-02 23:09:50 +02:00
|
|
|
|
|
|
|
|
Console.WriteLine();
|
|
|
|
|
Console.WriteLine("The RID for the current OS and CPU is:");
|
|
|
|
|
var currentRid = Environment.GetCurrentRid();
|
|
|
|
|
Console.WriteLine($"- {currentRid}");
|
2025-04-14 19:29:56 +02:00
|
|
|
}
|
|
|
|
|
}
|