Files
agent_jrxml/start.bat
T
panda 960312b088 fix: start.bat nested quote parsing with path containing spaces
cmd /k "cd /d "%~dp0" && ..." breaks because inner quotes around
%~dp0 close the outer quoted string prematurely when the path
contains spaces (D:\Idea Project\...). Fix: remove outer quotes,
escape && as ^&^& so it passes through to the new cmd instance.
2026-05-21 22:14:17 +08:00

54 lines
1.8 KiB
Batchfile

@echo off
setlocal enabledelayedexpansion
echo ============================================
echo JRXML Agent - One-Click Start
echo ============================================
echo.
REM ========== Kill processes on ports ==========
echo [Pre-check] Cleaning up occupied ports...
for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":8001.*LISTENING" 2^>nul') do (
echo Killing PID %%a on port 8001...
taskkill /PID %%a /F 2>nul
)
for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":8000.*LISTENING" 2^>nul') do (
echo Killing PID %%a on port 8000...
taskkill /PID %%a /F 2>nul
)
for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":5173.*LISTENING" 2^>nul') do (
echo Killing PID %%a on port 5173...
taskkill /PID %%a /F 2>nul
)
echo.
REM ========== Detect Python ==========
set PYTHON=python
if exist "%~dp0.venv\Scripts\python.exe" set "PYTHON=%~dp0.venv\Scripts\python.exe"
echo Using Python: %PYTHON%
echo.
REM ========== Start services ==========
echo [1/3] Starting validation service on port 8001...
start "JRXML-Validator" cmd /k cd /d "%~dp0" ^&^& "%PYTHON%" -m uvicorn validation_service.main:app --port 8001 --host 0.0.0.0
timeout /t 3 /nobreak >nul
echo [2/3] Starting backend API on port 8000...
start "JRXML-API" cmd /k cd /d "%~dp0" ^&^& "%PYTHON%" -m uvicorn api_server:app --port 8000 --host 0.0.0.0
timeout /t 3 /nobreak >nul
echo [3/3] Starting frontend dev server on port 5173...
start "JRXML-Frontend" cmd /k cd /d "%~dp0frontend" ^&^& npm run dev
timeout /t 3 /nobreak >nul
echo.
echo ============================================
echo All services started!
echo Frontend : http://localhost:5173
echo Backend : http://localhost:8000
echo Validator : http://localhost:8001
echo ============================================
echo.
echo Close the service windows or run stop.bat to stop.
pause