Simplify conditional logic for better readability

Co-authored-by: DRSDavidSoft <4673812+DRSDavidSoft@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-11-07 14:40:21 +00:00
parent aa6b28a2b0
commit 73739407b1

View File

@@ -161,12 +161,10 @@ function Fetch-DownloadUrl {
:loop foreach ($i in $info) {
# Skip pre-release versions unless explicitly included
# Pre-releases include RC (Release Candidate), beta, alpha, and other test versions
if (-not $includePrerelease) {
if (Test-IsPrerelease $i) {
if (-not $includePrerelease -and (Test-IsPrerelease $i)) {
Write-Verbose "Skipping pre-release version: $($i.tag_name)"
continue
}
}
if (-not ($i.assets -is [array])) {
continue
@@ -210,11 +208,9 @@ function Fetch-DownloadUrl {
$selectedRelease = $null
foreach ($release in $info) {
# Apply the same filtering logic
if (-not $includePrerelease) {
if (Test-IsPrerelease $release) {
if (-not $includePrerelease -and (Test-IsPrerelease $release)) {
continue
}
}
# Use the first release that passes the filter
$selectedRelease = $release
break