From 08032e38c75a8ed5b34ff1ada2b2fb20397d84f9 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Fri, 8 Mar 2024 14:06:33 +0300 Subject: [PATCH] Use par-each --- git-clone-all.nu | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/git-clone-all.nu b/git-clone-all.nu index 85a9983..0324c7e 100755 --- a/git-clone-all.nu +++ b/git-clone-all.nu @@ -9,17 +9,12 @@ def main [ } 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" + print --stderr $"(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)" } + | par-each { git clone $"https://github.com/($in.full_name)" } - print "\nDone!" + print --stderr "\nDone!" }