From 4e7afb77905b6e81be80249f6ab97ea682251a3d Mon Sep 17 00:00:00 2001 From: brogers5 <6869577+brogers5@users.noreply.github.com> Date: Wed, 12 Jul 2023 13:28:28 -0400 Subject: [PATCH] Warn when release notes URL is identical to last release's --- update.ps1 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/update.ps1 b/update.ps1 index c1f8112..074716c 100644 --- a/update.ps1 +++ b/update.ps1 @@ -4,15 +4,26 @@ $userAgent = "Update checker of Chocolatey Community Package 'xsplit-vcam'" function global:au_BeforeUpdate ($Package) { if ([string]::IsNullOrWhiteSpace($Latest.ReleaseNotes)) { - Write-Warning 'release_notes_url is not available - falling back on redirect from canonical URL' + 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' $canonicalUri = 'https://xspl.it/vcam/relnotes' $response = Invoke-WebRequest -Uri $canonicalUri -UserAgent $userAgent -MaximumRedirection 0 -SkipHttpErrorCheck -UseBasicParsing -ErrorAction SilentlyContinue $redirectedUri = $response.Headers['Location'] - + $Latest.ReleaseNotes = $redirectedUri } + $packageReleaseNotes = $Package.NuspecXml.package.metadata.releaseNotes + + #SplitMediaLabs sometimes reuses URLs or doesn't bother to publish new release notes. + #For package release note purposes, note when this happens. + if ($packageReleaseNotes -eq $Latest.ReleaseNotes) { + Write-Warning 'releaseNotes URL is identical' + Write-Warning 'URL may have been reused, or no URL may be available' + } + #Archive this version for future development, since the vendor does not guarantee perpetual availability $filePath = ".\XSplit_VCam_$($Latest.Version).msi" Invoke-WebRequest -Uri $Latest.Url64 -OutFile $filePath