mirror of
https://github.com/ScoopInstaller/Scoop.git
synced 2025-12-07 16:45:34 +00:00
add well-known bucket functionality (only extras so far)
This commit is contained in:
3
buckets.json
Normal file
3
buckets.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extras": "https://github.com/lukesampson/scoop-extras.git"
|
||||
}
|
||||
@@ -4,6 +4,13 @@ function bucketdir($name) {
|
||||
"$bucketsdir\$name"
|
||||
}
|
||||
|
||||
function known_bucket_repo($name) {
|
||||
$dir = versiondir 'scoop' 'current'
|
||||
$json = "$dir\buckets.json"
|
||||
$buckets = gc $json -raw | convertfrom-json -ea stop
|
||||
$buckets.$name
|
||||
}
|
||||
|
||||
<#
|
||||
# convert an object to a hashtable
|
||||
function hashtable($obj) {
|
||||
|
||||
@@ -25,7 +25,10 @@ $usage_rm = "usage: scoop bucket rm <name>"
|
||||
|
||||
function add_bucket($name, $repo) {
|
||||
if(!$name) { "<name> missing"; $usage_add; exit 1 }
|
||||
if(!$repo) { "<repo> missing"; $usage_add; exit 1 }
|
||||
if(!$repo) {
|
||||
$repo = known_bucket_repo $name
|
||||
if(!$repo) { "unknown bucket '$name': try specifying <repo>"; $usage_add; exit 1 }
|
||||
}
|
||||
|
||||
$git = try { gcm 'git' -ea stop } catch { $null }
|
||||
if(!$git) {
|
||||
|
||||
Reference in New Issue
Block a user