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 source/lastupdate for buckets list ([#4704](https://github.com/ScoopInstaller/Scoop/pull/4704))

### Builds

Expand Down
34 changes: 29 additions & 5 deletions libexec/scoop-bucket.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,43 @@
# 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
$updated = 'N/A'
if (Test-Path (Join-Path $source '.git')) {
$updated = git_cmd -C "`"$source`"" log --format='%ch' -n 1
$source = git_cmd -C "`"$source`"" config remote.origin.url
}
Comment thread
HUMORCE marked this conversation as resolved.
if ($source.StartsWith((Get-PSProvider 'FileSystem').Home)) {
$source = $source.Replace((Get-PSProvider 'FileSystem').Home, '~')
}
Comment thread
HUMORCE marked this conversation as resolved.
Outdated

$buckets += New-Object PSObject -Property @{
Name = $bucket
Source = $source
Updated = $updated
}
}

return $buckets | Select-Object Name, Source, Updated | Format-Table -AutoSize -Wrap
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