Files
sanguo_vnpy_v2/sanguo_qmt_bridge/update.bat
T

41 lines
1.2 KiB
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@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