Skip to content

Commit 7373940

Browse files
CopilotDRSDavidSoft
andcommitted
Simplify conditional logic for better readability
Co-authored-by: DRSDavidSoft <[email protected]>
1 parent aa6b28a commit 7373940

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

scripts/update.ps1

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,9 @@ function Fetch-DownloadUrl {
161161
:loop foreach ($i in $info) {
162162
# Skip pre-release versions unless explicitly included
163163
# Pre-releases include RC (Release Candidate), beta, alpha, and other test versions
164-
if (-not $includePrerelease) {
165-
if (Test-IsPrerelease $i) {
166-
Write-Verbose "Skipping pre-release version: $($i.tag_name)"
167-
continue
168-
}
164+
if (-not $includePrerelease -and (Test-IsPrerelease $i)) {
165+
Write-Verbose "Skipping pre-release version: $($i.tag_name)"
166+
continue
169167
}
170168

171169
if (-not ($i.assets -is [array])) {
@@ -210,10 +208,8 @@ function Fetch-DownloadUrl {
210208
$selectedRelease = $null
211209
foreach ($release in $info) {
212210
# Apply the same filtering logic
213-
if (-not $includePrerelease) {
214-
if (Test-IsPrerelease $release) {
215-
continue
216-
}
211+
if (-not $includePrerelease -and (Test-IsPrerelease $release)) {
212+
continue
217213
}
218214
# Use the first release that passes the filter
219215
$selectedRelease = $release

0 commit comments

Comments
 (0)