mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-12-21 13:31:30 -06:00
Redirect dev to latest Full Release if can't find prerelease (#2225)
* Redirect dev to latest Fulll Release if can't catch prerelease * Fix logic and URL to select the latest release (#2) * Compile Winutil * fix redirect to latest release --------- Co-authored-by: Marterich <Marterich@users.noreply.github.com> * Set Powershell Window Title * moved setting Window Name * remove setting Windowname Window Name gets overwritten --------- Co-authored-by: Martin Wiethan <47688561+Marterich@users.noreply.github.com> Co-authored-by: Marterich <Marterich@users.noreply.github.com>
This commit is contained in:
parent
747b1d76fd
commit
8984c177a0
@ -20,7 +20,7 @@ function Get-LatestRelease {
|
||||
return $latestRelease.tag_name
|
||||
} catch {
|
||||
Write-Host "Error fetching release data: $_" -ForegroundColor Red
|
||||
return $null
|
||||
return $latestRelease.tag_name
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,12 +29,14 @@ 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
|
||||
|
||||
RedirectToLatestPreRelease
|
||||
RedirectToLatestPreRelease
|
||||
|
Loading…
Reference in New Issue
Block a user