Skip to content
Merged
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
- **diagnostic** Skip check for 'exclusionPath' if defender realtime protect is disabled ([#4699](https://github.com/ScoopInstaller/Scoop/pull/4699))
- **scoop-checkup** Skip 'check_windows_defender' when have not admin privileges ([#4699](https://github.com/ScoopInstaller/Scoop/pull/4699))
- **scoop-checkup** Separate defender issues, mark as performance problem instead potential problem ([#4699](https://github.com/ScoopInstaller/Scoop/pull/4699))
- **scoop-bucket** Show detailed information for bucket list ([#4704](https://github.com/ScoopInstaller/Scoop/pull/4704))

### Builds

Expand Down
37 changes: 32 additions & 5 deletions libexec/scoop-bucket.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,46 @@
# scoop bucket known
param($cmd, $name, $repo)

. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\buckets.ps1"
. "$psscriptroot\..\lib\help.ps1"
. "$PSScriptRoot\..\lib\core.ps1"
. "$PSScriptRoot\..\lib\buckets.ps1"
. "$PSScriptRoot\..\lib\help.ps1"

reset_aliases

$usage_add = "usage: scoop bucket add <name> [<repo>]"
$usage_rm = "usage: scoop bucket rm <name>"

switch($cmd) {
function list_buckets {
$buckets = @()

foreach ($bucket in Get-LocalBucket) {
$source = Find-BucketDirectory $bucket -Root
$manifests = (
Get-ChildItem "$source\bucket" -Force -Recurse -ErrorAction SilentlyContinue |
Measure-Object | Select-Object -ExpandProperty Count
)
$updated = 'N/A'
if (Test-Path (Join-Path $source '.git')) {
$updated = git_cmd -C "`"$source`"" log --date=format:"`"%Y-%m-%d %H:%M:%S`"" --format='%ad' -n 1
$source = git_cmd -C "`"$source`"" config remote.origin.url
} else {
$updated = (Get-Item "$source\bucket").LastWriteTime | Get-Date -Format 'yyyy-MM-dd HH:mm:ss'
$source = friendly_path $source
}
Comment thread
HUMORCE marked this conversation as resolved.
$buckets += New-Object PSObject -Property @{
Name = $bucket
Source = $source
Updated = $updated
Manifests = $manifests
}
}
return ($buckets | Select-Object Name, Source, Updated, Manifests | Out-String).Trim()
Comment thread
HUMORCE marked this conversation as resolved.
Outdated
}

switch ($cmd) {
'add' { add_bucket $name $repo }
'rm' { rm_bucket $name }
'list' { Get-LocalBucket }
'list' { list_buckets }
'known' { known_buckets }
default { "scoop bucket: cmd '$cmd' not supported"; my_usage; exit 1 }
}
Expand Down