synchronization

This commit is contained in:
2025-08-25 16:04:54 +08:00
commit cbae9a4800
6 changed files with 182 additions and 0 deletions

27
Build.sh Normal file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
#############################################################################################
# 用途: Clone 项目
# 作者: 丁辉
# 编写时间: 2024-01-18
#############################################################################################
# 项目仓库
IFS=$'\n'
# 读取文件并存入数组
GIT_NAME=($(<repositories.list))
# 恢复默认的分隔符
unset IFS
for i in "${GIT_NAME[@]}"; do
GIT_URL=$(echo $i | awk -F '//' '{print $2}')
git clone -b main --depth=1 https://$1:$2@$GIT_URL
GIT_FILE=$(echo $i | sed 's/\.git$//' | grep -oE '[^/]+$')
rm -rf $GIT_FILE/.git
echo $GIT_FILE >> file.txt
done
# 打包
tar -zcvf Git_Backup.tar.gz $(cat file.txt)