LAUNCHER.ps1 (1020B)
1 $ErrorActionPreference = "Stop" 2 Set-Location $PSScriptRoot 3 4 Write-Host "[Bzl] Launcher UI" -ForegroundColor Cyan 5 if (-not (Get-Command node -ErrorAction SilentlyContinue)) { throw "Missing node (Node.js 18+ required)" } 6 7 $port = $env:BZL_LAUNCHER_PORT 8 if (-not $port) { $port = 8787 } 9 $url = "http://127.0.0.1:$port/" 10 11 Write-Host "[Bzl] Starting local UI..." -ForegroundColor Yellow 12 Write-Host "[Bzl] UI URL: $url" -ForegroundColor DarkGray 13 14 # Open in the background (node keeps this console busy). 15 $urlEsc = $url.Replace("'", "''") 16 Start-Process -WindowStyle Hidden -FilePath "powershell.exe" -ArgumentList @( 17 "-NoProfile", 18 "-Command", 19 "Start-Sleep -Seconds 2; Start-Process '$urlEsc'" 20 ) | Out-Null 21 22 node .\\scripts\\launcher-ui.js 23 24 if ($LASTEXITCODE -ne 0) { 25 Write-Host "" 26 Write-Host "[Bzl] Launcher UI exited (code $LASTEXITCODE)." -ForegroundColor Red 27 Write-Host "[Bzl] If it closed immediately, check: $PSScriptRoot\\launcher-ui.crash.log" -ForegroundColor DarkGray 28 Read-Host "Press Enter to close" 29 }