Skip to content

Commit

Permalink
Chocolatey v2 Support (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanbergstrom committed Feb 12, 2023
1 parent 9c49b35 commit eb850c3
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.1.0] - 2023-02-11

#### Added

- Future support for Chocolatey v2

## [0.0.3] - 2023-02-06

#### Fixed
Expand All @@ -23,7 +29,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Initial release

[Unreleased]: https://github.com/AnyPackage/AnyPackage.Chocolatey/compare/v0.0.3...HEAD
[Unreleased]: https://github.com/AnyPackage/AnyPackage.Chocolatey/compare/v0.1.0...HEAD
[0.1.0]: https://github.com/AnyPackage/AnyPackage.Chocolatey/releases/tag/v0.1.0
[0.0.3]: https://github.com/AnyPackage/AnyPackage.Chocolatey/releases/tag/v0.0.3
[0.0.2]: https://github.com/AnyPackage/AnyPackage.Chocolatey/releases/tag/v0.0.2
[0.0.1]: https://github.com/AnyPackage/AnyPackage.Chocolatey/releases/tag/v0.0.1
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ AnyPackage.Chocolatey integrates with Choco.exe to manage and store source infor
### Compatibility
AnyPackage.Chocolatey works with PowerShell for both FullCLR/'Desktop' (ex 5.1) and CoreCLR (ex: 7.0.1), though Chocolatey itself still requires FullCLR.

Users must upgrade to v0.1.0 or higher of this provider module prior to the release of Chocolatey v2 to ensure continued compatibility.

### Save a package
Save-Package is not supported with the AnyPackage.Chocolatey provider, due to Chocolatey not supporting package downloads without special licensing.

Expand Down
4 changes: 2 additions & 2 deletions src/AnyPackage.Chocolatey.psd1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@{
RootModule = 'AnyPackage.Chocolatey.psm1'
ModuleVersion = '0.0.3'
ModuleVersion = '0.1.0'
CompatiblePSEditions = @('Desktop', 'Core')
GUID = '070f2b8f-c7db-4566-9296-2f7cc9146bf0'
Author = 'Ethan Bergstrom'
Expand All @@ -17,7 +17,7 @@
},
@{
ModuleName = 'Foil'
ModuleVersion = '0.1.0'
ModuleVersion = '0.3.0'
}
)
PrivateData = @{
Expand Down
2 changes: 1 addition & 1 deletion src/private/Find-ChocoPackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function Find-ChocoPackage {
# We apply additional package name filtering when using wildcards to make Chocolatey's wildcard behavior more PowerShell-esque
# The final results must be grouped by package name, showing the highest available version for install, to make the results easier to consume
# Choco does not include source information in it's result set, so we need to include it in the results as a calculated property
Foil\Get-ChocoPackage @chocoParams |
Foil\Find-ChocoPackage @chocoParams |
Where-Object {$Request.IsMatch($_.Name)} |
Where-Object {-Not $Request.Version -Or (([NuGet.Versioning.VersionRange]$Request.Version).Satisfies($_.Version))} | Group-Object Name |
Select-Object Name,@{
Expand Down
1 change: 1 addition & 0 deletions src/private/Get-ChocoPackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ function Get-ChocoPackage {
)

$chocoParams = @{
# Remove this flag after the release of Chocolatey v2
LocalOnly = $true
AllVersions = $true
}
Expand Down

0 comments on commit eb850c3

Please sign in to comment.