From b25b1e0331bcd6cc3ea9615011d991ffc2cc14f6 Mon Sep 17 00:00:00 2001 From: claude_dev Date: Sat, 11 Jul 2026 07:44:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(bridge):=20D-2=20update.bat=E5=8D=8A?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=9B=B4=E6=96=B0=E8=84=9A=E6=9C=AC(git=20pu?= =?UTF-8?q?ll+=E9=87=8D=E5=90=AFbridge,=20=E5=8F=8C=E5=87=BB=E8=BF=90?= =?UTF-8?q?=E8=A1=8C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sanguo_qmt_bridge/update.bat | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 sanguo_qmt_bridge/update.bat diff --git a/sanguo_qmt_bridge/update.bat b/sanguo_qmt_bridge/update.bat new file mode 100644 index 0000000..4478c51 --- /dev/null +++ b/sanguo_qmt_bridge/update.bat @@ -0,0 +1,40 @@ +@echo off +chcp 65001 >nul +REM ============================================================ +REM sanguo bridge 半自动更新(D-2) +REM 用法:双击运行 = git pull 拉最新 + 重启 bridge +REM 前提:① 本仓库已 git clone 到本机 ② 已设 BRIDGE_TOKEN 环境变量 +REM ============================================================ + +REM 脚本在 sanguo_qmt_bridge/,仓库根是上一级 +set REPO_ROOT=%~dp0.. +cd /d "%REPO_ROOT%" + +echo ============================================================ +echo sanguo bridge 更新 +echo ============================================================ +echo. + +echo [1/3] git pull 拉最新代码... +git pull --ff-only +if errorlevel 1 ( + echo. + echo [!] git pull 失败 —— 检查网络 / gitea token 是否过期。 + pause + exit /b 1 +) +echo. + +echo [2/3] 当前版本: +git log -1 --format=" %h %s" +echo. + +echo [3/3] 重启 bridge... +taskkill /f /im uvicorn.exe 2>nul +timeout /t 2 >nul +start "sanguo-bridge" cmd /k "cd /d %~dp0 && uvicorn bridge:app --host 127.0.0.1 --port 8765" +echo. +echo [OK] 完成。bridge 已在新窗口启动(看到 "xtquant 连接成功" 即就绪)。 +echo 旧的 uvicorn 窗口可以关掉。 +echo. +pause