Skip to content

Commit

Permalink
housekeeping: Add exact version matching only for uap assemblies (#189)
Browse files Browse the repository at this point in the history
* housekeeping: Make icsharpcode non-package

* housekeeping: Add exact version matching only for uap assemblies
  • Loading branch information
glennawatson authored Dec 7, 2020
1 parent e453f5d commit db0d7b8
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/Pharmacist.Core/Utilities/AssemblyHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,8 @@ internal static class AssemblyHelpers

private static string FindClosestVersionDirectory(string basePath, Version version)
{
string? path = null;
foreach (var (versionFolder, name) in new DirectoryInfo(basePath)
.EnumerateDirectories()
.Select(d => ConvertToVersion(d.Name))
.Where(v => v.Version != null)
.OrderBy(v => v.Version))
{
if (path == null || versionFolder >= version)
{
path = name;
}
}
var directory = new DirectoryInfo(basePath);
string? path = directory.EnumerateDirectories().Select(d => ConvertToVersion(d.Name)).Where(x => x.Version is not null && x.Version == version).Select(x => x.Name).FirstOrDefault();

return path ?? version.ToString();
}
Expand Down

0 comments on commit db0d7b8

Please sign in to comment.