Files
2026-08-16 18:24:52 +07:00

46 lines
1.2 KiB
Batchfile

@echo off
echo =============================================
echo HOT-Step 9000 CPP - Production
echo =============================================
echo.
REM Check dependencies are installed
if not exist "%~dp0server\node_modules" (
echo ERROR: Server dependencies not installed.
echo Run install.bat first, or: cd server ^& npm install
echo.
pause
exit /b 1
)
REM Build UI if dist doesn't exist
if not exist "%~dp0ui\dist" (
if not exist "%~dp0ui\node_modules" (
echo ERROR: UI dependencies not installed.
echo Run install.bat first, or: cd ui ^& npm install
echo.
pause
exit /b 1
)
echo Building UI...
cd /d "%~dp0ui"
call npm run build
)
REM Start server (which spawns ace-server) with restart loop
cd /d "%~dp0server"
echo Starting server...
REM Open browser if no existing tab is found
start /MIN "" powershell -ExecutionPolicy Bypass -File "%~dp0open-browser-if-needed.ps1" "http://localhost:3001/" 4
:loop
call npx tsx src/index.ts
if exist "%~dp0.restart-requested" (
del "%~dp0.restart-requested"
echo.
echo [HOT-Step] Restarting server...
timeout /t 2 /nobreak > nul
goto loop
)