Install the newest release including pre-releases by default

This commit is contained in:
Emil
2026-08-02 22:03:10 +03:00
parent 0494b8bc2a
commit a339ac853b
2 changed files with 28 additions and 8 deletions
+16 -4
View File
@@ -23,12 +23,24 @@ $Arch = switch ($env:PROCESSOR_ARCHITECTURE) {
}
if ($Version -eq "latest") {
Write-Host "Resolving the latest SciMesh release..."
$Url = "https://github.com/$Repo/releases/latest/download/coordinator-windows-$Arch.exe"
} else {
$Url = "https://github.com/$Repo/releases/download/$Version/coordinator-windows-$Arch.exe"
Write-Host "Resolving the newest SciMesh release (including pre-releases)..."
# /releases/latest only sees stable releases; the API list is newest-first
# across all channels.
try {
$Releases = Invoke-RestMethod -Uri "https://api.github.com/repos/$Repo/releases?per_page=1"
if ($Releases -and $Releases[0].tag_name) {
$Version = $Releases[0].tag_name
Write-Host " -> $Version"
} else {
Write-Host " -> falling back to the stable latest release"
}
} catch {
Write-Host " -> falling back to the stable latest release"
}
}
$Url = "https://github.com/$Repo/releases/download/$Version/coordinator-windows-$Arch.exe"
New-Item -ItemType Directory -Force -Path $InstallDir | Out-Null
$Target = Join-Path $InstallDir "coordinator.exe"