Some checks failed
Strudel tests / build (20) (push) Has been cancelled
- install.ps1: instala Node deps + build + venv de KISUM (un comando). - strudel-launcher.ps1: sirve la web, arranca el servidor KISUM y abre el navegador. - kisum/kisum.cmd: lanzador de KISUM por terminal en Windows. - WINDOWS.md: guía de instalación y uso. Fase 2 (instalador .exe) propuesta. Pendiente de probar en un Windows real; no toca nada de la versión Linux. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
34 lines
1.4 KiB
PowerShell
34 lines
1.4 KiB
PowerShell
# 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
|