1
Fork 0
mirror of https://github.com/RGBCube/random-scripts synced 2025-05-14 02:54:58 +00:00

Add clone all script

This commit is contained in:
RGBCube 2023-12-06 16:25:09 +03:00
parent 8a73e9c800
commit 4f14279e6c
No known key found for this signature in database

25
git-clone-all.nu Executable file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env nu
def main [
--org (-o): string = ""
--user (-u): string = ""
] {
let path = if not ($org | is-empty) {
"orgs/" + $org
} else if not ($user | is-empty) {
"users/" + $user
} else {
""
}
if ($path | is-empty) {
echo $"(ansi red)error:(ansi reset) either org or user must be supplied"
exit 1
}
# Couldn't get parallel to work correctly so whatever.
http get https://api.github.com/($path)/repos
| each { git clone $"https://github.com/($in.full_name)" }
print "\nDone!"
}