mirror of
https://github.com/cmderdev/cmder.git
synced 2025-11-08 21:29:02 +08:00
Simplify conditional logic for better readability
Co-authored-by: DRSDavidSoft <4673812+DRSDavidSoft@users.noreply.github.com>
This commit is contained in:
@@ -161,11 +161,9 @@ function Fetch-DownloadUrl {
|
|||||||
:loop foreach ($i in $info) {
|
:loop foreach ($i in $info) {
|
||||||
# Skip pre-release versions unless explicitly included
|
# Skip pre-release versions unless explicitly included
|
||||||
# Pre-releases include RC (Release Candidate), beta, alpha, and other test versions
|
# Pre-releases include RC (Release Candidate), beta, alpha, and other test versions
|
||||||
if (-not $includePrerelease) {
|
if (-not $includePrerelease -and (Test-IsPrerelease $i)) {
|
||||||
if (Test-IsPrerelease $i) {
|
Write-Verbose "Skipping pre-release version: $($i.tag_name)"
|
||||||
Write-Verbose "Skipping pre-release version: $($i.tag_name)"
|
continue
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (-not ($i.assets -is [array])) {
|
if (-not ($i.assets -is [array])) {
|
||||||
@@ -210,10 +208,8 @@ function Fetch-DownloadUrl {
|
|||||||
$selectedRelease = $null
|
$selectedRelease = $null
|
||||||
foreach ($release in $info) {
|
foreach ($release in $info) {
|
||||||
# Apply the same filtering logic
|
# Apply the same filtering logic
|
||||||
if (-not $includePrerelease) {
|
if (-not $includePrerelease -and (Test-IsPrerelease $release)) {
|
||||||
if (Test-IsPrerelease $release) {
|
continue
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
# Use the first release that passes the filter
|
# Use the first release that passes the filter
|
||||||
$selectedRelease = $release
|
$selectedRelease = $release
|
||||||
|
|||||||
Reference in New Issue
Block a user