Skip to content

Commit

Permalink
fix: Homepage no longer downloaded on script
Browse files Browse the repository at this point in the history
  • Loading branch information
notPlancha committed Jan 18, 2025
1 parent ac6f1ba commit 13f5092
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions bin/checkver.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -279,25 +279,26 @@ while ($in_progress -gt 0) {
next "'replace' requires 're' or 'regex'"
continue
}
$err = $ev.SourceEventArgs.Error
if ($err) {
next "$($err.message)`r`nURL $url is not valid"
continue
}

if ($url) {
$ms = New-Object System.IO.MemoryStream
$ms.Write($result, 0, $result.Length)
$ms.Seek(0, 0) | Out-Null
if ($result[0] -eq 0x1F -and $result[1] -eq 0x8B) {
$ms = New-Object System.IO.Compression.GZipStream($ms, [System.IO.Compression.CompressionMode]::Decompress)
}
$page = (New-Object System.IO.StreamReader($ms, (Get-Encoding $wc))).ReadToEnd()
}
$source = $url
if ($script) {
$page = Invoke-Command ([scriptblock]::Create($script -join "`r`n"))
$source = 'the output of script'
} else {
$err = $ev.SourceEventArgs.Error
if ($err) {
next "$($err.message)`r`nURL $url is not valid"
continue
}

if ($url) {
$ms = New-Object System.IO.MemoryStream
$ms.Write($result, 0, $result.Length)
$ms.Seek(0, 0) | Out-Null
if ($result[0] -eq 0x1F -and $result[1] -eq 0x8B) {
$ms = New-Object System.IO.Compression.GZipStream($ms, [System.IO.Compression.CompressionMode]::Decompress)
}
$page = (New-Object System.IO.StreamReader($ms, (Get-Encoding $wc))).ReadToEnd()
}
$source = $url
}

if ($jsonpath) {
Expand Down

0 comments on commit 13f5092

Please sign in to comment.