Skip to content

Commit

Permalink
Account for empty arch and os options
Browse files Browse the repository at this point in the history
  • Loading branch information
sfoslund committed Jul 19, 2021
1 parent 2a2ff7a commit bbee38b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Cli/dotnet/ParseResultExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,12 @@ public static bool BothArchAndOsOptionsSpecified(this ParseResult parseResult) =
internal static string GetCommandLineRuntimeIdentifier(this ParseResult parseResult)
{
return parseResult.HasOption(RunCommandParser.RuntimeOption) ?
parseResult.ValueForOption<string>(RunCommandParser.RuntimeOption) :
CommonOptions.ResolveRidShorthandOptionsToRuntimeIdentifier(
parseResult.ValueForOption<string>(CommonOptions.OperatingSystemOption().Aliases.First()),
parseResult.ValueForOption<string>(CommonOptions.ArchitectureOption().Aliases.First()));
parseResult.ValueForOption<string>(RunCommandParser.RuntimeOption) :
parseResult.HasOption(CommonOptions.OperatingSystemOption().Aliases.First()) || parseResult.HasOption(CommonOptions.ArchitectureOption().Aliases.First()) ?
CommonOptions.ResolveRidShorthandOptionsToRuntimeIdentifier(
parseResult.ValueForOption<string>(CommonOptions.OperatingSystemOption().Aliases.First()),
parseResult.ValueForOption<string>(CommonOptions.ArchitectureOption().Aliases.First())) :
null;
}
}
}

0 comments on commit bbee38b

Please sign in to comment.