mirror of
https://github.com/ScoopInstaller/Main.git
synced 2025-11-11 03:01:22 +00:00
pester: Add checkver script
* Add checkver script that checks all release tags (similar to `main/pnpm`) * Pester mixes ver4 and ver5 in their releases. This will prevent the "wrong revert" error preemptively.
This commit is contained in:
parent
06ffaa7eb8
commit
692b4b8a8d
@ -14,7 +14,20 @@
|
|||||||
"name": "Pester"
|
"name": "Pester"
|
||||||
},
|
},
|
||||||
"checkver": {
|
"checkver": {
|
||||||
"github": "https://github.com/pester/Pester"
|
"script": [
|
||||||
|
"# Using checkver script to check through all release tags",
|
||||||
|
"$url = 'https://api.github.com/repos/pester/Pester/releases'",
|
||||||
|
"$latest_ver = [Version]::new(0,0,0,0) # note: Powershell 5 does not support casting 'int' or 'float' to 'System.Version'",
|
||||||
|
"$releases = $(Invoke-WebRequest $url).Content | ConvertFrom-Json",
|
||||||
|
"$releases | ForEach-Object {",
|
||||||
|
" if (!($_.tag_name -match '([\\d.]+)')) { return }",
|
||||||
|
" $ver = [Version]::new($matches[1])",
|
||||||
|
" if ($ver -gt $latest_ver) { $latest_ver = $ver }",
|
||||||
|
"}",
|
||||||
|
"if ($latest_ver -eq [Version]::new(0,0,0,0)) { error \"Could not match version string in '$url'\"; break }",
|
||||||
|
"Write-Output $latest_ver"
|
||||||
|
],
|
||||||
|
"regex": "([\\d.]+)"
|
||||||
},
|
},
|
||||||
"autoupdate": {
|
"autoupdate": {
|
||||||
"url": "https://globalcdn.nuget.org/packages/pester.$version.nupkg"
|
"url": "https://globalcdn.nuget.org/packages/pester.$version.nupkg"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user