Refresh reconnect send address and guard prebuilts
ci / test (push) Has been cancelled
ci / fuzz-smoke (push) Has been cancelled
ci / windows-client (push) Has been cancelled
ci / package-release (linux-x86_64, ubuntu-latest) (push) Has been cancelled
ci / package-release (macos-aarch64, macos-14) (push) Has been cancelled
ci / package-release (macos-x86_64, macos-13) (push) Has been cancelled
ci / package-release (windows-x86_64, windows-latest) (push) Has been cancelled
ci / remote-bench (push) Has been cancelled
ci / test (push) Has been cancelled
ci / fuzz-smoke (push) Has been cancelled
ci / windows-client (push) Has been cancelled
ci / package-release (linux-x86_64, ubuntu-latest) (push) Has been cancelled
ci / package-release (macos-aarch64, macos-14) (push) Has been cancelled
ci / package-release (macos-x86_64, macos-13) (push) Has been cancelled
ci / package-release (windows-x86_64, windows-latest) (push) Has been cancelled
ci / remote-bench (push) Has been cancelled
This commit is contained in:
+26
@@ -116,6 +116,31 @@ function Verify-ArchiveChecksum($Url, $Archive) {
|
||||
}
|
||||
}
|
||||
|
||||
function Expected-ArchiveVersion($Url) {
|
||||
if ($Url -match "/releases/download/v([^/]+)/") {
|
||||
return $Matches[1]
|
||||
}
|
||||
if (-not $BinaryUrl -and -not $BinaryBase -and $BinaryVersion -ne "latest") {
|
||||
return $BinaryVersion.TrimStart("v")
|
||||
}
|
||||
return $null
|
||||
}
|
||||
|
||||
function Verify-ArchiveVersion($ExtractDir, $Url) {
|
||||
$expected = Expected-ArchiveVersion $Url
|
||||
if (-not $expected) {
|
||||
return
|
||||
}
|
||||
$versionFile = Get-ChildItem -Path $ExtractDir -Recurse -File -Filter VERSION | Select-Object -First 1
|
||||
if (-not $versionFile) {
|
||||
throw "prebuilt archive missing VERSION for $Url"
|
||||
}
|
||||
$actual = (Get-Content $versionFile.FullName -Raw).Trim()
|
||||
if ($actual -ne $expected) {
|
||||
throw "prebuilt archive version mismatch for ${Url}: expected $expected, got $actual"
|
||||
}
|
||||
}
|
||||
|
||||
$bindir = Join-Path $Prefix "bin"
|
||||
$configDir = Join-Path $HOME ".config\dosh"
|
||||
New-Item -ItemType Directory -Force -Path $bindir, $configDir | Out-Null
|
||||
@@ -137,6 +162,7 @@ function Install-Prebuilt {
|
||||
Invoke-WebRequest -UseBasicParsing -Uri $url -OutFile $zip
|
||||
Verify-ArchiveChecksum $url $zip
|
||||
Expand-Archive -Force -Path $zip -DestinationPath $extract
|
||||
Verify-ArchiveVersion $extract $url
|
||||
foreach ($bin in @("dosh-client.exe", "dosh-bench.exe")) {
|
||||
$found = Get-ChildItem -Path $extract -Recurse -File -Filter $bin | Select-Object -First 1
|
||||
if (-not $found) {
|
||||
|
||||
Reference in New Issue
Block a user