- 将下方文件保存到一个"cloneAll.sh"文件中:
#!/bin/bash
if [ -z "$1" ]; then
echo "waiting for the following arguments: username + max-page-number"
exit 1
else
name=$1
fi
if [ -z "$2" ]; then
max=2
else
max=$2
fi
cntx="users"
page=1
echo $name
echo $max
echo $cntx
echo $page
until (( $page -lt $max ))
do
curl "https://api.github.com/$cntx/$name/repos?page=$page&per_page=100" | grep -e 'clone_url*' | cut -d \" -f 4 | xargs -L1 git clone
$page=$page+1
done
exit 0
- 在
githuBash
窗口执行指令:
sh cloneAll.sh YourUserName PageCount
编者:艾孜尔江
标签:克隆,name,一次性,仓库,max,echo,sh,page,cntx From: https://www.cnblogs.com/ezhar/p/17207941.html