I'm trying to clone a set of repositories from GitHub. It works but I can't work out how to add a destination folder with xargs
. This is what I currently have
curl "https://api.github.com/orgs/$org/repos?access_token=$authToken" |
grep -e 'clone_url*' |
grep -w clone_url |
grep -o '[^"]\+://.\+.git' |
xargs -L1 git clone
Except I want the cloned repositories to go into a another directory ./my_folder
. I've tried changing the last line:
xargs -L1 git clone "./my_folder"
But this does not work. I can't work out how to add on the extra argument using xargs
. The normal way would be to just add the destination folder on to the end of the command like in this answer but I can't quite work out how to do this with my code.