1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| #!/bin/bash
code_addr=( 'git@gitlab.com:project/project1.git' 'git@gitlab.com:project/project2.git' 'git@gitlab.com:project/project3.git' ) website_dir=website clone_code(){ if [ -d $website_dir ];then echo "文件夹存在" cd $website_dir else echo "文件不存在,创建$website_dir文件夹" mkdir $website_dir && cd $website_dir fi for i in ${code_addr[@]} do git clone $i done } clone_code echo "website项目组已拉取完毕!"
|