From 25075805f279a9922013f69f4f38a47b17163a7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B0=8F=E4=BA=91?= Date: Sat, 24 Jan 2026 11:34:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .devops/monitor.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.devops/monitor.py b/.devops/monitor.py index 2ce0f1a..f3638b1 100644 --- a/.devops/monitor.py +++ b/.devops/monitor.py @@ -160,7 +160,14 @@ class GitMonitor: Logger.error("拉取主仓库失败") return False - # 更新所有子模块 + # 初始化和更新所有子模块(包括新增的子模块) + cmd = "git submodule update --init --recursive" + result = subprocess.run(cmd, shell=True, cwd=repo_path, capture_output=True, text=True) + if result.returncode != 0: + Logger.error("初始化子模块失败") + return False + + # 更新所有子模块到最新代码 cmd = f"git submodule foreach 'git checkout {self.global_branch} && git pull'" result = subprocess.run(cmd, shell=True, cwd=repo_path, capture_output=True, text=True) if result.returncode != 0: