Files
GitMa/start-full.bat
panw c625425971 fix: Windows compatibility and startup scripts
- Add explicit .env loading in config.py for Windows compatibility
- Add backend directory to sys.path in main.py to fix module imports
- Add start.bat and start-full.bat for Windows startup
- Add frontend/package-lock.json for dependency tracking

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 19:23:23 +08:00

101 lines
2.4 KiB
Batchfile
Raw Permalink 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
echo ========================================
echo Git Repo Manager - 一键安装启动
echo ========================================
echo.
REM 步骤 1: 检查 Python
python --version >nul 2>&1
if errorlevel 1 (
echo [错误] 未找到 Python
echo 请先安装 Python 3.8+: https://www.python.org/downloads/
pause
exit /b 1
)
echo [√<>] Python 已安装
echo.
REM 步骤 2: 检查 Node.js
node --version >nul 2>&1
if errorlevel 1 (
echo [警告] 未找到 Node.js前端开发需要用到
echo 安装 Node.js: https://nodejs.org/
echo.
)
REM 步骤 3: 检查 .env 文件
if not exist ".env" (
if exist ".env.example" (
echo [1/4] 复制 .env.example 到 .env...
copy .env.example .env >nul
echo [提示] 请编辑 .env 文件,设置您的密钥!
echo 需要设置 GM_ENCRYPT_KEY 和 GM_API_TOKEN
echo.
notepad .env
pause
) else (
echo [错误] .env.example 文件不存在!
pause
exit /b 1
)
) else (
echo [1/4] .env 配置文件已存在... ✓
)
echo.
REM 步骤 4: 安装 Python 依赖
echo [2/4] 检查 Python 依赖...
pip show fastapi >nul 2>&1
if errorlevel 1 (
echo 正在安装 Python 依赖...
pip install -r backend\requirements.txt
if errorlevel 1 (
echo [错误] 依赖安装失败!
pause
exit /b 1
)
) else (
echo [2/4] Python 依赖已安装... ✓
)
echo.
REM 步骤 5: 初始化数据库
if not exist "data\git_manager.db" (
echo [3/4] 初始化数据库...
python -m backend.init_db
if errorlevel 1 (
echo [错误] 数据库初始化失败!
pause
exit /b 1
)
) else (
echo [3/4] 数据库已初始化... ✓
)
echo.
REM 步骤 6: 安装前端依赖(可选)
if exist "frontend\package.json" (
if not exist "frontend\node_modules\" (
echo [提示] 安装前端依赖...
echo 跳过(可选,开发模式需要)
REM cd frontend && npm install
)
)
echo.
REM 步骤 7: 启动服务
echo [4/4] 启动 Git Repo Manager...
echo.
echo ========================================
echo 服务地址: http://%GM_HOST%:%GM_PORT%
echo API 文档: http://%GM_HOST%:%GM_PORT%/docs
echo ========================================
echo.
echo 按 Ctrl+C 停止服务
echo.
REM 启动 FastAPI 服务器
uvicorn backend.app.main:app --host %GM_HOST% --port %GM_PORT% --reload