Skip to content
This repository has been archived by the owner on Nov 25, 2022. It is now read-only.

Commit

Permalink
feat: cleanup all buckets
Browse files Browse the repository at this point in the history
  • Loading branch information
Cologler committed Aug 27, 2021
1 parent 29a35f3 commit 91c61f8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions libexec/scoop-cleanup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,27 @@ function cleanup($app, $global, $verbose, $cache) {
write-host ''
}

function Cleanup-Buckets {
Get-LocalBucket | ForEach-Object {
Write-Host "Cleanuping '$_' bucket..." -ForegroundColor Green
$bucketDirFullPath = Find-BucketDirectory $_ -Root
if (Test-Path "$bucketDirFullPath\.git" -PathType Container) {
Push-Location $bucketDirFullPath
try {
git_proxy_cmd gc --auto
}
finally {
Pop-Location
}
}
}
}

# cleanup all apps
if ($apps) {
$verbose = $true
if ($apps -eq '*') {
Cleanup-Buckets
$verbose = $false
$apps = applist (installed_apps $false) $false
if ($global) {
Expand All @@ -75,6 +93,8 @@ if ($apps) {
if (!$verbose) {
success 'Everything is shiny now!'
}
} else {
Cleanup-Buckets
}

exit 0

0 comments on commit 91c61f8

Please sign in to comment.