Skip to content

Commit

Permalink
Fix logic and URL to select the latest release (#2)
Browse files Browse the repository at this point in the history
* Compile Winutil

* fix redirect to latest release

---------

Co-authored-by: Marterich <Marterich@users.noreply.github.com>
  • Loading branch information
Marterich and Marterich authored Jun 30, 2024
1 parent f838e80 commit b3bc01f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions windev.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand All @@ -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
Expand Down

0 comments on commit b3bc01f

Please sign in to comment.