Skip to content

Commit

Permalink
added lower case check for package paths (#1493)
Browse files Browse the repository at this point in the history
  • Loading branch information
deepchoudhery committed Feb 8, 2021
1 parent 83d9805 commit 4194ca7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/VS.Web.CG.Msbuild/ProjectContextWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ internal string GetPath(string nugetPath, Tuple<string, string> nameAndVersion)
if (!string.IsNullOrEmpty(nugetPath) && !string.IsNullOrEmpty(nameAndVersion.Item1) && !string.IsNullOrEmpty(nameAndVersion.Item2))
{
path = Path.Combine(nugetPath, nameAndVersion.Item1, nameAndVersion.Item2);
path = Directory.Exists(path) ? path : Path.Combine(nugetPath, nameAndVersion.Item1.ToLower(), nameAndVersion.Item2);
}

return path;
Expand Down
8 changes: 4 additions & 4 deletions test/VS.Web.CG.MSBuild.Test/ProjectContextWriterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public void TestProjectContextFromMsBuild()
}

[SkippableTheory]
[InlineData("C:\\Users\\User\\.nuget\\packages\\", "X.Y.Z", "1.2.3", "C:\\Users\\User\\.nuget\\packages\\X.Y.Z\\1.2.3")]
[InlineData("C:\\Users\\User\\.nuget\\", "X.Y.Z", "1.2.3", "C:\\Users\\User\\.nuget\\X.Y.Z\\1.2.3")]
[InlineData("C:\\Users\\User\\.nuget\\packages\\", "X.Y.Z", "1.2.3", "C:\\Users\\User\\.nuget\\packages\\x.y.z\\1.2.3")]
[InlineData("C:\\Users\\User\\.nuget\\", "X.Y.Z", "1.2.3", "C:\\Users\\User\\.nuget\\x.y.z\\1.2.3")]
[InlineData("C:\\Users\\User\\.nuget\\packages\\", null, null, "")]
[InlineData("C:\\Users\\User\\.nuget\\packages\\", "X.Y.Z", null, "")]
[InlineData("C:\\Users\\User\\.nuget\\packages\\", null, "1.2.3", "")]
Expand All @@ -64,8 +64,8 @@ public void GetPathTestWindows(string nugetPath, string packageName, string vers
}

[SkippableTheory]
[InlineData("C://Users//User//.nuget//packages//", "X.Y.Z", "1.2.3", "C://Users//User//.nuget//packages//X.Y.Z//1.2.3")]
[InlineData("C://Users//User//.nuget//", "X.Y.Z", "1.2.3", "C://Users//User//.nuget//X.Y.Z//1.2.3")]
[InlineData("C://Users//User//.nuget//packages//", "X.Y.Z", "1.2.3", "C://Users//User//.nuget//packages//x.y.z//1.2.3")]
[InlineData("C://Users//User//.nuget//", "X.Y.Z", "1.2.3", "C://Users//User//.nuget//x.y.z//1.2.3")]
[InlineData("C://Users//User//.nuget//packages//", null, null, "")]
[InlineData("C://Users//User//.nuget//packages//", "X.Y.Z", null, "")]
[InlineData("C://Users//User//.nuget//packages//", null, "1.2.3", "")]
Expand Down

0 comments on commit 4194ca7

Please sign in to comment.