Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
use au_GalleryUrl if provided when checking package existence
Browse files Browse the repository at this point in the history
closes #95
  • Loading branch information
majkinetor committed May 15, 2018
1 parent 84865e1 commit 50d0b76
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion AU/Public/Update-Package.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ function Update-Package {
$script:is_forced = $false
if ([AUVersion] $Latest.Version -gt [AUVersion] $Latest.NuspecVersion) {
if (!($NoCheckChocoVersion -or $Force)) {
$choco_url = "https://chocolatey.org/packages/{0}/{1}" -f $global:Latest.PackageName, $package.RemoteVersion
if ( !$au_GalleryUrl ) { $au_GalleryUrl = 'https://chocolatey.org' }
$choco_url = "$au_GalleryUrl/packages/{0}/{1}" -f $global:Latest.PackageName, $package.RemoteVersion
try {
request $choco_url $Timeout | out-null
"New version is available but it already exists in the Chocolatey community feed (disable using `$NoCheckChocoVersion`):`n $choco_url" | result
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# AU Project Changelog

## Next
- `Update-Package`: Now you can pass HTTP/HTTPS headers to `$Latest.Options.Headers` to avoid `Unauthorized` errors while checking URLs.
- `Update-Package`:
- Now you can pass HTTP/HTTPS headers to `$Latest.Options.Headers` to avoid `Unauthorized` errors while checking URLs.
- Package Gallery URL is no longer hard-coded but taken from the `$au_GalleryUrl` if it exists ([#95](https://github.com/majkinetor/au/issues/95))
- `Update-AUPackages`: Added `NoCheckChocoVersion` option.
- Plugins:
- `Git`: Added `Branch` parameter to specify a branch name
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ This is the same as if you added the parameters to `update` function inside the

however, its way easier to setup global variable with manual intervention on multiple packages.

There is also a special variable `$au_GalleryUrl` using which you can change the URL that is used to check if package is already pushed. It defaults to https://chocolatey.org and you can change it if you need to this option for 3rd party or internal package repositories.

### Reusing the AU updater with metapackages

Metapackages can reuse an AU updater of its dependency by the following way:
Expand Down

0 comments on commit 50d0b76

Please sign in to comment.