bzl

self-hosted ephemeral community engine
Log | Files | Refs | README | LICENSE

LAUNCHER.cmd (1042B)


      1 @echo off
      2 setlocal
      3 pushd "%~dp0"
      4 echo [Bzl] Launcher UI
      5 where node >nul 2>nul
      6 if errorlevel 1 (
      7   echo Missing node. Node.js 18+ required.
      8   echo.
      9   pause
     10   popd
     11   exit /b 1
     12 )
     13 for /f %%v in ('node -p "process.versions.node"') do set "NODEVER=%%v"
     14 for /f "tokens=1 delims=." %%a in ("%NODEVER%") do set "NODEMAJOR=%%a"
     15 if %NODEMAJOR% LSS 18 (
     16   echo Node.js 18+ required. Found: v%NODEVER%
     17   echo Please update Node.js, then try again.
     18   echo.
     19   pause
     20   popd
     21   exit /b 1
     22 )
     23 set "UI_PORT=%BZL_LAUNCHER_PORT%"
     24 if "%UI_PORT%"=="" set "UI_PORT=8787"
     25 set "URL=http://127.0.0.1:%UI_PORT%/"
     26 echo [Bzl] Starting local UI...
     27 echo It should open in your browser automatically.
     28 echo If it doesn't, open: %URL%
     29 echo.
     30 rem Open in the background (node keeps this console busy).
     31 start "" cmd /c "timeout /t 2 /nobreak >nul & start \"\" \"%URL%\""
     32 node .\scripts\launcher-ui.js
     33 set code=%ERRORLEVEL%
     34 if not "%code%"=="0" (
     35   echo.
     36   echo [Bzl] UI exited (code %code%).
     37   echo If it closed immediately, check: %~dp0launcher-ui.crash.log
     38   pause
     39 )
     40 popd
     41 endlocal