Skip to content

Commit

Permalink
fix(scoop-hold): Use 'foreach' loop to allow 'continue' statement (Sc…
Browse files Browse the repository at this point in the history
  • Loading branch information
niheaven authored Jul 25, 2024
1 parent 5dc5dd2 commit 49ee8ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions libexec/scoop-hold.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,21 @@ 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) {
error "'$app' is not installed globally."
} else {
error "'$app' is not installed."
}
return
continue
}

if (get_config NO_JUNCTION) {
Expand Down

0 comments on commit 49ee8ad

Please sign in to comment.