# Lanzador de Strudel (fork hacklab) + KISUM para Windows (PowerShell). # powershell -ExecutionPolicy Bypass -File .\strudel-launcher.ps1 # Sirve la build estática, arranca el servidor de KISUM y abre el navegador. # ⚠ Escrito y revisado, pero pendiente de probar en un Windows real. $DIR = Split-Path -Parent $MyInvocation.MyCommand.Path $PORT = if ($env:STRUDEL_PORT) { $env:STRUDEL_PORT } else { 3009 } $URL = "http://127.0.0.1:$PORT/" $ASTRO = Join-Path $DIR "website\node_modules\.bin\astro.cmd" function Test-Up($u) { try { Invoke-WebRequest -UseBasicParsing -Uri $u -TimeoutSec 2 | Out-Null; return $true } catch { return $false } } if (-not (Test-Path $ASTRO)) { Write-Error "Falta la instalación. Ejecuta antes: powershell -ExecutionPolicy Bypass -File .\install.ps1" } # --- Servidor web (astro preview) --- if (-not (Test-Up $URL)) { Start-Process -WindowStyle Hidden -WorkingDirectory (Join-Path $DIR "website") ` -FilePath $ASTRO -ArgumentList "preview","--port","$PORT","--host","127.0.0.1" for ($i = 0; $i -lt 30; $i++) { if (Test-Up $URL) { break }; Start-Sleep -Seconds 1 } } # --- Servidor KISUM (si tiene venv) --- $KPY = Join-Path $DIR "kisum\.venv\Scripts\python.exe" if (Test-Path $KPY) { if (-not (Test-Up "http://127.0.0.1:3010/health")) { Start-Process -WindowStyle Hidden -FilePath $KPY -ArgumentList (Join-Path $DIR "kisum\kisum_server.py") } } # --- Abrir navegador --- Start-Process $URL