From b3bc01feeafbc1012f84edcd52a2f7019193bd7b Mon Sep 17 00:00:00 2001 From: Martin Wiethan <47688561+Marterich@users.noreply.github.com> Date: Sun, 30 Jun 2024 13:13:04 +0200 Subject: [PATCH] Fix logic and URL to select the latest release (#2) * Compile Winutil * fix redirect to latest release --------- Co-authored-by: Marterich --- windev.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/windev.ps1 b/windev.ps1 index bce34401..6ad84f4f 100644 --- a/windev.ps1 +++ b/windev.ps1 @@ -20,8 +20,6 @@ function Get-LatestRelease { return $latestRelease.tag_name } catch { Write-Host "Error fetching release data: $_" -ForegroundColor Red - Write-Host "Redirecting to latest Full Release" - $latestRelease = "releases/latest/download" return $latestRelease.tag_name } } @@ -31,10 +29,12 @@ function RedirectToLatestPreRelease { $latestRelease = Get-LatestRelease if ($latestRelease) { $url = "https://raw.githubusercontent.com/ChrisTitusTech/winutil/$latestRelease/winutil.ps1" - Invoke-RestMethod $url | Invoke-Expression } else { Write-Host 'Unable to determine latest pre-release version.' -ForegroundColor Red + Write-Host "Using latest Full Release" + $url = "https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1" } + Invoke-RestMethod $url | Invoke-Expression } # Call the redirect function