Skip to content

Commit

Permalink
Warn if release notes URL provided by API server does not match the c…
Browse files Browse the repository at this point in the history
…anonical URL
  • Loading branch information
brogers5 committed Jul 12, 2023
1 parent 4e7afb7 commit ee4d99f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ Import-Module au
$userAgent = "Update checker of Chocolatey Community Package 'xsplit-vcam'"

function global:au_BeforeUpdate ($Package) {
if ([string]::IsNullOrWhiteSpace($Latest.ReleaseNotes)) {
$apiProvidedReleaseNotes = $Latest.ReleaseNotes
if ([string]::IsNullOrWhiteSpace($apiProvidedReleaseNotes)) {
Write-Warning 'release_notes_url is not available'
Write-Warning 'SplitMediaLabs may not have published release notes yet - consider delaying package release!'
Write-Warning 'For now, falling back on redirect from canonical URL'
Expand All @@ -22,6 +23,12 @@ function global:au_BeforeUpdate ($Package) {
if ($packageReleaseNotes -eq $Latest.ReleaseNotes) {
Write-Warning 'releaseNotes URL is identical'
Write-Warning 'URL may have been reused, or no URL may be available'

if ($apiProvidedReleaseNotes -ne $Latest.ReleaseNotes) {
Write-Warning 'Please manually review the provided URLs, then edit the package metadata and repack if appropriate:'
Write-Warning "API: '$apiProvidedReleaseNotes'"
Write-Warning "Canonical: '$($Latest.ReleaseNotes)'"
}
}

#Archive this version for future development, since the vendor does not guarantee perpetual availability
Expand Down

0 comments on commit ee4d99f

Please # to comment.