forked from MobileGL-Dev/MobileGlues
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathupdate.bash
More file actions
executable file
·35 lines (29 loc) · 882 Bytes
/
Copy pathupdate.bash
File metadata and controls
executable file
·35 lines (29 loc) · 882 Bytes
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
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# 配置 Git 用户
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
# 只初始化 3rdparty 下的子模块
echo "初始化 3rdparty 子模块..."
git submodule update --init MobileGlues-cpp/3rdparty/*
# 进入 3rdparty 目录更新子模块
cd MobileGlues-cpp/3rdparty
for dir in */; do
if [ -d "$dir/.git" ]; then
echo "更新子模块: $dir"
cd "$dir"
git pull origin $(git branch --show-current || echo "main")
cd ..
fi
done
cd ..
# 更新父仓库中的子模块引用
echo "更新父仓库中的子模块引用..."
git submodule update --remote --recursive 3rdparty/*
# 提交更新
git add --all
if ! git diff-index --quiet HEAD --; then
git commit -m "Automated 3rdparty submodule update $(date)"
git push
else
echo "没有 3rdparty 子模块更新"
fi