OPEN_BOARD_VIEWER.cmd 450 B

123456789101112131415161718
  1. @echo off
  2. setlocal
  3. cd /d "%~dp0"
  4. where py >nul 2>nul
  5. if errorlevel 1 goto use_python
  6. py -3.12 -c "import sys; raise SystemExit(0 if sys.version_info[:2] == (3, 12) else 1)" >nul 2>nul
  7. if errorlevel 1 goto use_python
  8. py -3.12 board_viewer.py serve --open-browser
  9. goto finished
  10. :use_python
  11. python board_viewer.py serve --open-browser
  12. :finished
  13. set "BOARD_VIEWER_EXIT=%ERRORLEVEL%"
  14. if not "%BOARD_VIEWER_EXIT%"=="0" pause
  15. exit /b %BOARD_VIEWER_EXIT%