Skip to content

Instantly share code, notes, and snippets.

@nuno-andre
Last active October 3, 2023 13:24
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nuno-andre/77f2b1adf42f29005045c04f0ed8d059 to your computer and use it in GitHub Desktop.
Save nuno-andre/77f2b1adf42f29005045c04f0ed8d059 to your computer and use it in GitHub Desktop.
Import scoop applications
# export applications
scoop export | sls '([A-Za-z0-9\-\_]+)' |% {
$_.matches.groups[1].value } > apps.txt
# export used buckets
$buckets = scoop export | sls '\[([A-Za-z0-9\-\_]+)\]' |% {
$_.matches.groups[1].value } | select -unique
<# or all installed buckets
$buckets = scoop bucket list
#>
# get upstream repos from buckets
# (so you can import "unknown" buckets)
$scoop_dir = (gi $(gcm scoop).source).directory.parent.fullname
foreach ($b in $buckets) {
git -C "$scoop_dir\buckets\$b" remote -v |
select -first 1 | sls '(\s\S+)' |% {
"$b $($_.matches.groups[1].value.trim())"
} >> buckets.txt
}
gc buckets.txt |% { scoop bucket add $_ }
gc apps.txt |% {scoop install $_}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment