From 86eab9ab46196c07e437d7077c3728bf46685a74 Mon Sep 17 00:00:00 2001 From: Hsiao-nan Cheung Date: Fri, 1 Jul 2022 11:36:06 +0800 Subject: [PATCH 1/2] builds(checkver): Exit routine earlier if error --- bin/checkver.ps1 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/checkver.ps1 b/bin/checkver.ps1 index b477afc2d6..b71bcf697e 100644 --- a/bin/checkver.ps1 +++ b/bin/checkver.ps1 @@ -218,20 +218,20 @@ while ($in_progress -gt 0) { $ver = $Version if (!$ver) { - $page = (Get-Encoding($wc)).GetString($ev.SourceEventArgs.Result) - $err = $ev.SourceEventArgs.Error - if ($json.checkver.script) { - $page = Invoke-Command ([scriptblock]::Create($json.checkver.script -join "`r`n")) + if (!$regex -and $replace) { + next "'replace' requires 're' or 'regex'" + continue } - + $err = $ev.SourceEventArgs.Error if ($err) { next "$($err.message)`r`nURL $url is not valid" continue } - if (!$regex -and $replace) { - next "'replace' requires 're' or 'regex'" - continue + if ($json.checkver.script) { + $page = Invoke-Command ([scriptblock]::Create($json.checkver.script -join "`r`n")) + } else { + $page = (Get-Encoding($wc)).GetString($ev.SourceEventArgs.Result) } if ($jsonpath) { From 9438435bdfae01f897ccc5f707c59eb9ee1624dd Mon Sep 17 00:00:00 2001 From: Hsiao-nan Cheung Date: Fri, 1 Jul 2022 11:43:30 +0800 Subject: [PATCH 2/2] docs(changelog): Update CHANGELOG [skip ci] --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9707edd90b..c43e60f9ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ - **scoop-search:** Output PSObject, use API token ([#4997](https://github.com/ScoopInstaller/Scoop/issues/4997)) +### Builds + +- **checkver:** Exit routine earlier if error ([#5025](https://github.com/ScoopInstaller/Scoop/issues/5025)) + ### Tests - **typo:** Fix typo ('formated' -> 'formatted') ([#4217](https://github.com/ScoopInstaller/Scoop/issues/4217))