diff --git a/CHANGELOG.md b/CHANGELOG.md index 180c2fe1ef..296acb220b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### Bug Fixes - **scoop-alias:** Fix 'Option --verbose not recognized.' ([#6062](https://github.com/ScoopInstaller/Scoop/issues/6062)) +- **scoop-hold:** Use 'foreach' loop to allow 'continue' statement ([#6078](https://github.com/ScoopInstaller/Scoop/issues/6078)) - **json:** Don't serialize jsonpath return if only one result ([#6066](https://github.com/ScoopInstaller/Scoop/issues/6066), [#6073](https://github.com/ScoopInstaller/Scoop/issues/6073)) ### Builds diff --git a/libexec/scoop-hold.ps1 b/libexec/scoop-hold.ps1 index 43f11b3259..504f20a849 100644 --- a/libexec/scoop-hold.ps1 +++ b/libexec/scoop-hold.ps1 @@ -29,14 +29,13 @@ if ($global -and !(is_admin)) { exit 1 } -$apps | ForEach-Object { - $app = $_ +foreach ($app in $apps) { if ($app -eq 'scoop') { $hold_update_until = [System.DateTime]::Now.AddDays(1) set_config HOLD_UPDATE_UNTIL $hold_update_until.ToString('o') | Out-Null success "$app is now held and might not be updated until $($hold_update_until.ToLocalTime())." - return + continue } if (!(installed $app $global)) { if ($global) { @@ -44,7 +43,7 @@ $apps | ForEach-Object { } else { error "'$app' is not installed." } - return + continue } if (get_config NO_JUNCTION) {