Skip to content

Commit

Permalink
feat(checkver): Debug checkver only in case of error
Browse files Browse the repository at this point in the history
  • Loading branch information
Ash258 committed Jul 25, 2020
1 parent e2d2b3f commit 5826266
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions bin/checkver.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ function Invoke-Check {

$state = $EventToCheck.SourceEventArgs.UserState

debug $state.url
debug $state.regex
debug $state.reverse
debug $state.replace

$appName = $state.app
$json = $state.json
$url = $state.url
Expand All @@ -110,7 +105,14 @@ function Invoke-Check {
if (Test-ScoopDebugEnabled) { Join-Path $PWD 'checkver-page-script.html' | Out-UTF8Content -Content $page }
}

if ($err) { next $appName "$($err.Message)`r`nURL $url is not valid" }
if ($err) {
debug $state.url
debug $state.regex
debug $state.reverse
debug $state.replace

next $appName "$($err.Message)`r`nURL $url is not valid"
}
if (!$regex -and $replace) { next $appName "'replace' requires 're' or 'regex'" }

if ($jsonpath) {
Expand Down

0 comments on commit 5826266

Please sign in to comment.