Skip to content

Commit

Permalink
Update rid file testing logic
Browse files Browse the repository at this point in the history
  • Loading branch information
sfoslund committed Jul 21, 2021
1 parent 3d453e2 commit 5e88e2e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Cli/dotnet/CommonOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ internal static string ResolveRidShorthandOptionsToRuntimeIdentifier(string os,
private static string GetCurrentRuntimeId()
{
var dotnetRootPath = Path.GetDirectoryName(Environment.ProcessPath);
dotnetRootPath = dotnetRootPath.Contains("dotnet") ? dotnetRootPath : Path.Combine(dotnetRootPath, "dotnet");
// When running under test the path does not always contain "dotnet" and Product.Version is empty.
dotnetRootPath = Path.GetFileName(dotnetRootPath).Contains("dotnet") ? dotnetRootPath : Path.Combine(dotnetRootPath, "dotnet");
var ridFileName = "NETCoreSdkRuntimeIdentifierChain.txt";
string runtimeIdentifierChainPath = string.IsNullOrEmpty(Product.Version) ?
Path.Combine(Directory.GetDirectories(Path.Combine(dotnetRootPath, "sdk"))[0], ridFileName) :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void ArchOptionCannotBeCombinedWithRuntime()
});
}

[Theory]
[WindowsOnlyTheory]
[InlineData("build")]
[InlineData("publish")]
[InlineData("test")]
Expand All @@ -114,7 +114,7 @@ public void CommandsRunWithOSOption(string command)
.Pass();
}

[Theory]
[WindowsOnlyTheory]
[InlineData("build")]
[InlineData("publish")]
[InlineData("test")]
Expand Down

0 comments on commit 5e88e2e

Please sign in to comment.