Skip to content

Commit d8b3cc8

Browse files
authored
fix(checkver): Correct error messages (#6024)
1 parent 9239c26 commit d8b3cc8

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
- **core:** Search for Git executable instead of any cmdlet ([#5998](https://github.com/ScoopInstaller/Scoop/issues/5998))
2323
- **core:** Use correct path in 'bash' ([#6006](https://github.com/ScoopInstaller/Scoop/issues/6006))
2424
- **core:** Limit the number of commands to get when search for git executable ([#6013](https://github.com/ScoopInstaller/Scoop/pull/6013))
25+
- **checkver:** Correct error messages ([#6024](https://github.com/ScoopInstaller/Scoop/issues/6024))
2526

2627
### Code Refactoring
2728

bin/checkver.ps1

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,10 @@ while ($in_progress -gt 0) {
294294
}
295295
$page = (New-Object System.IO.StreamReader($ms, (Get-Encoding $wc))).ReadToEnd()
296296
}
297+
$source = $url
297298
if ($script) {
298299
$page = Invoke-Command ([scriptblock]::Create($script -join "`r`n"))
300+
$source = 'the output of script'
299301
}
300302

301303
if ($jsonpath) {
@@ -310,7 +312,7 @@ while ($in_progress -gt 0) {
310312
$ver = json_path_legacy $page $jsonpath
311313
}
312314
if (!$ver) {
313-
next "couldn't find '$jsonpath' in $url"
315+
next "couldn't find '$jsonpath' in $source"
314316
continue
315317
}
316318
}
@@ -332,7 +334,7 @@ while ($in_progress -gt 0) {
332334
# Getting version from XML, using XPath
333335
$ver = $xml.SelectSingleNode($xpath, $nsmgr).'#text'
334336
if (!$ver) {
335-
next "couldn't find '$($xpath -replace 'ns:', '')' in $url"
337+
next "couldn't find '$($xpath -replace 'ns:', '')' in $source"
336338
continue
337339
}
338340
}
@@ -366,13 +368,13 @@ while ($in_progress -gt 0) {
366368
$ver = $matchesHashtable['version']
367369
}
368370
} else {
369-
next "couldn't match '$regexp' in $url"
371+
next "couldn't match '$regexp' in $source"
370372
continue
371373
}
372374
}
373375

374376
if (!$ver) {
375-
next "couldn't find new version in $url"
377+
next "couldn't find new version in $source"
376378
continue
377379
}
378380
}

0 commit comments

Comments
 (0)