bzl

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

LAUNCHER.cmd (1052B)


      1 @echo off
      2 setlocal
      3 pushd "%~dp0"
      4 echo [Bzl] Launcher UI (dev)
      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 
     24 set "UI_PORT=%BZL_LAUNCHER_PORT%"
     25 if "%UI_PORT%"=="" set "UI_PORT=8787"
     26 set "URL=http://127.0.0.1:%UI_PORT%/"
     27 
     28 echo [Bzl] Starting local UI...
     29 echo It should open in your browser automatically.
     30 echo If it doesn't, open: %URL%
     31 echo.
     32 
     33 rem Open in the background (node keeps this console busy).
     34 start "" cmd /c "timeout /t 2 /nobreak >nul & start \"\" \"%URL%\""
     35 node .\scripts\launcher-ui.js
     36 set code=%ERRORLEVEL%
     37 if not "%code%"=="0" (
     38   echo.
     39   echo [Bzl] UI exited (code %code%).
     40   echo If it closed immediately, check: %~dp0launcher-ui.crash.log
     41   pause
     42 )
     43 popd
     44 endlocal
     45