run_react.bat 852 B

1234567891011121314151617181920212223242526272829
  1. @echo off
  2. chcp 65001 >nul
  3. title Android Remote Controller - Development
  4. echo Checking environment and installing dependencies...
  5. powershell -ExecutionPolicy Bypass -File enviroment-check.ps1
  6. if %ERRORLEVEL% EQU 0 (
  7. echo.
  8. echo Starting project...
  9. echo Starting Vite dev server...
  10. start /B npm run dev
  11. echo Waiting for Vite server to be ready...
  12. timeout /t 3 /nobreak >nul
  13. :wait_loop
  14. powershell -Command "try { $response = Invoke-WebRequest -Uri 'http://localhost:9527' -TimeoutSec 1 -UseBasicParsing; exit 0 } catch { exit 1 }" >nul 2>&1
  15. if %ERRORLEVEL% NEQ 0 (
  16. timeout /t 1 /nobreak >nul
  17. goto wait_loop
  18. )
  19. echo Vite server is ready!
  20. echo Starting Electron...
  21. npx electron .
  22. ) else (
  23. echo.
  24. echo Environment check failed. Please fix the errors above.
  25. pause
  26. exit /b 1
  27. )