1
Fork 0
mirror of https://github.com/RGBCube/random-scripts synced 2025-05-14 02:54:58 +00:00
random-scripts/git-clone-all.nu
2024-03-08 14:06:33 +03:00

20 lines
461 B
Text
Executable file

#!/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 {
print --stderr $"(ansi red)error:(ansi reset) either org or user must be supplied"
exit 1
}
http get https://api.github.com/($path)/repos
| par-each { git clone $"https://github.com/($in.full_name)" }
print --stderr "\nDone!"
}