Skip to content

Commit

Permalink
builds(checkver): Exit routine earlier if error (#5025)
Browse files Browse the repository at this point in the history
  • Loading branch information
niheaven authored Jul 1, 2022
1 parent 53f0e9a commit 794f8a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
### Builds

- **checkver,auto-pr:** Allow passing file path ([#5019](https://github.com/ScoopInstaller/Scoop/issues/5019))
- **checkver:** Exit routine earlier if error ([#5025](https://github.com/ScoopInstaller/Scoop/issues/5025))

### Tests

Expand Down
16 changes: 8 additions & 8 deletions bin/checkver.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -224,20 +224,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) {
Expand Down

0 comments on commit 794f8a5

Please sign in to comment.