Skip to content

Commit

Permalink
Fix NuGet.Versioning removal (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasNieto authored Mar 16, 2023
1 parent bae4758 commit d746728
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/AnyPackage.WinGet.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
RequiredModules = @(
@{
ModuleName = 'AnyPackage'
ModuleVersion = '0.1.0'
ModuleVersion = '0.4.1'
},
@{
ModuleName = 'Cobalt'
Expand Down
2 changes: 1 addition & 1 deletion src/private/Find-WinGetPackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function Find-WinGetPackage {

# Perform an additional query to get all available versions, and create a package object for each version
$version = Cobalt\Get-WinGetPackageInfo -ID $candidate.ID -Versions -Source $selectedSource |
Where-Object {-Not $Request.Version -Or (([NuGet.Versioning.VersionRange]$Request.Version).Satisfies($_))} |
Where-Object {-Not $Request.Version -Or $Request.Version.Satisfies($_)} |
Select-Object -First 1

# WinGet doesn't return source information when source is specified, so we have to construct a fresh object here with the source information included
Expand Down
2 changes: 1 addition & 1 deletion src/private/Get-WinGetPackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ function Get-WinGetPackage {
# We apply additional package name filtering when using wildcards to make WinGet's wildcard behavior more PowerShell-esque
Cobalt\Get-WinGetPackage |
Where-Object {$Request.IsMatch($_.ID)} |
Where-Object {-Not $Request.Version -Or (([NuGet.Versioning.VersionRange]$Request.Version).Satisfies($_.Version))}
Where-Object {-Not $Request.Version -Or $Request.Version.Satisfies($_.Version)}
}

0 comments on commit d746728

Please sign in to comment.