Files
tianxuan/rollback.bat
PM-pinou 7a670fd5e2 feat(scripts): add update.bat and rollback.bat launchers
Add user-facing launchers for the incremental update system:
- update.bat: one-click update launcher
- rollback.bat: rollback to previous version
- tests/test_update_integration.py: integration tests for the update system
- README.md: add incremental update guide (section 10)
- .gitignore: add .update_cache/ entry

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-20 14:14:17 +08:00

46 lines
1.2 KiB
Batchfile

@echo off
chcp 65001 >nul
cd /d "%~dp0"
echo ================================================
echo 天璇 回滚工具
echo ================================================
echo.
echo 将从 %APPDATA%\TianXuan\backups\ 恢复最近一次备份
echo.
echo ⚠️ 警告:回滚操作会覆盖当前的项目文件!
echo 这包括代码文件、配置等。
echo.
set /p CONFIRM=确认回滚?(y/N):
if /i not "%CONFIRM%"=="y" (
echo 已取消回滚
pause
exit /b 0
)
:: Check portable Python exists
if not exist "runtime\python\python.exe" (
echo [ERROR] 找不到便携 Python 运行时
pause
exit /b 1
)
echo 正在回滚,请勿关闭此窗口...
echo.
runtime\python\python.exe scripts\apply_update.py --rollback
if %ERRORLEVEL% neq 0 (
echo.
echo [ERROR] 回滚失败!请手动从备份目录恢复
echo 备份位于: %APPDATA%\TianXuan\backups\
pause
exit /b %ERRORLEVEL%
)
echo.
echo ================================================
echo ✅ 回滚完成!
echo ================================================
echo.
echo 请关闭此窗口,然后重新双击 run.bat 启动回滚前的版本
echo.
pause