Skip to content

Commit 666d474

Browse files
authored
feat(scoop-update): Support scoop update scoop (#4992)
1 parent e7c0faa commit 666d474

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### Features
44

55
- **core:** Add `Get-Encoding` function to fix missing webclient encoding ([#4956](https://github.com/ScoopInstaller/Scoop/issues/4956))
6+
- **scoop-update:** Support `scoop update scoop` ([#4992](https://github.com/ScoopInstaller/Scoop/issues/4992))
67
- **scoop-virustotal:** Migrate to virustotal api v3, improve flows, and ouput powershell objects ([#4983](https://github.com/ScoopInstaller/Scoop/pull/4983))
78
- **scoop-hold,scoop-unhold:** Support `-g`/`--global` flag ([#4991](https://github.com/ScoopInstaller/Scoop/issues/4991))
89

lib/core.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ function Confirm-InstallationStatus {
855855
$Global
856856
)
857857
$Installed = @()
858-
$Apps | Select-Object -Unique | Where-Object { $_.Name -ne 'scoop' } | ForEach-Object {
858+
$Apps | Select-Object -Unique | Where-Object { $_ -ne 'scoop' } | ForEach-Object {
859859
$App, $null, $null = parse_app $_
860860
if ($Global) {
861861
if (Test-Path (appdir $App $true)) {

libexec/scoop-update.ps1

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,19 +306,24 @@ if (-not ($apps -or $all)) {
306306
'ERROR: You need admin rights to update global apps.'; exit 1
307307
}
308308

309-
if (is_scoop_outdated) {
310-
update_scoop
311-
}
312309
$outdated = @()
310+
$updateScoop = $null -ne ($apps | Where-Object { $_ -eq 'scoop' }) -or (is_scoop_outdated)
311+
$apps = $apps | Where-Object { $_ -ne 'scoop' }
313312
$apps_param = $apps
314313

314+
if ($updateScoop) {
315+
update_scoop
316+
}
317+
315318
if ($apps_param -eq '*' -or $all) {
316319
$apps = applist (installed_apps $false) $false
317320
if ($global) {
318321
$apps += applist (installed_apps $true) $true
319322
}
320323
} else {
321-
$apps = Confirm-InstallationStatus $apps_param -Global:$global
324+
if ($apps_param) {
325+
$apps = Confirm-InstallationStatus $apps_param -Global:$global
326+
}
322327
}
323328
if ($apps) {
324329
$apps | ForEach-Object {

0 commit comments

Comments
 (0)