Last active
June 13, 2024 18:31
-
-
Save nuno-andre/77f2b1adf42f29005045c04f0ed8d059 to your computer and use it in GitHub Desktop.
Import scoop applications
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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