fix: stderr nativo via cmd /c por NativeCommandError en PS 5.1 (issue 4002)

This commit is contained in:
hermes committed 2026-09-12 19:04:00 +02:00
1 parent 6c3a594a14
commit d192e3c434
4 files changed
+34 -16

No files matched your search

+7 -4
View File
@@ -63,7 +63,9 @@ if (-not (Get-Command docker -ErrorAction SilentlyContinue)) {
Write-Host ' https://docs.docker.com/desktop/setup/install/windows-install/'
exit 1
}
try { docker info *> $null } catch {
# En PS 5.1, *> $null sobre comandos nativos convierte stderr en errores
# terminantes con EAP=Stop (PS #4002). Se descarta via cmd /c.
if (-not (cmd /c "docker info >NUL 2>&1")) {
Err 'Docker Desktop no responde. Abre Docker Desktop y espera a que arranque.'
exit 1
}
@@ -107,7 +109,8 @@ if (-not $running) {
Warn ' Esperando a que Ollama arranque...'
$MaxWait = 60; $Waited = 0
while ($true) {
docker exec d0a1-hermes-ollama ollama ps *> $null
# Descarte de stderr via cmd /c (ver nota de PS 5.1 / PS #4002 arriba)
cmd /c "docker exec d0a1-hermes-ollama ollama ps >NUL 2>&1"
if ($LASTEXITCODE -eq 0) { break }
Start-Sleep -Seconds 2
$Waited += 2
@@ -124,7 +127,7 @@ Ok "Ollama corriendo en http://localhost:${OllamaPort}"
# --- 2. Instalar Hermes Agent ------------------------------------------------
Warn '[2/3] Instalando Hermes Agent...'
if (Get-Command hermes -ErrorAction SilentlyContinue) {
Ok "Hermes Agent ya instalado: $(hermes --version 2>$null)"
Ok "Hermes Agent ya instalado: $(cmd /c 'hermes --version 2>NUL')"
} else {
# En Windows: instala con winget o pip. El install.sh de Linux no aplica.
Write-Host ' Instalando con pip (requiere Python 3.10+)...'
@@ -134,7 +137,7 @@ if (Get-Command hermes -ErrorAction SilentlyContinue) {
Write-Host ' https://hermes-agent.nousresearch.com/docs'
exit 1
}
Ok "Hermes Agent instalado: $(hermes --version 2>$null)"
Ok "Hermes Agent instalado: $(cmd /c 'hermes --version 2>NUL')"
}
# --- 3. Configurar ------------------------------------------------------------
+7 -4
View File
@@ -63,7 +63,9 @@ if (-not (Get-Command docker -ErrorAction SilentlyContinue)) {
Write-Host ' https://docs.docker.com/desktop/setup/install/windows-install/'
exit 1
}
try { docker info *> $null } catch {
# En PS 5.1, *> $null sobre comandos nativos convierte stderr en errores
# terminantes con EAP=Stop (PS #4002). Se descarta via cmd /c.
if (-not (cmd /c "docker info >NUL 2>&1")) {
Err 'Docker Desktop no responde. Abre Docker Desktop y espera a que arranque.'
exit 1
}
@@ -107,7 +109,8 @@ if (-not $running) {
Warn ' Esperando a que Ollama arranque...'
$MaxWait = 60; $Waited = 0
while ($true) {
docker exec d0a1-openclaw-ollama ollama ps *> $null
# Descarte de stderr via cmd /c (ver nota de PS 5.1 / PS #4002 arriba)
cmd /c "docker exec d0a1-openclaw-ollama ollama ps >NUL 2>&1"
if ($LASTEXITCODE -eq 0) { break }
Start-Sleep -Seconds 2
$Waited += 2
@@ -124,7 +127,7 @@ Ok "Ollama corriendo en http://localhost:${OllamaPort}"
# --- 2. Instalar OpenClaw -----------------------------------------------------
Warn '[2/3] Instalando OpenClaw...'
if (Get-Command openclaw -ErrorAction SilentlyContinue) {
Ok "OpenClaw ya instalado: $(openclaw --version 2>$null)"
Ok "OpenClaw ya instalado: $(cmd /c 'openclaw --version 2>NUL')"
} else {
# En Windows: instala con npm (Node 18+). El install.sh de Linux no aplica.
Write-Host ' Instalando con npm (requiere Node.js 18+)...'
@@ -134,7 +137,7 @@ if (Get-Command openclaw -ErrorAction SilentlyContinue) {
Write-Host ' https://openclaw.ai/docs'
exit 1
}
Ok "OpenClaw instalado: $(openclaw --version 2>$null)"
Ok "OpenClaw instalado: $(cmd /c 'openclaw --version 2>NUL')"
}
# --- 3. Configurar ------------------------------------------------------------
+10 -4
View File
@@ -61,16 +61,21 @@ if (-not (Get-Command docker -ErrorAction SilentlyContinue)) {
Write-Host ' https://docs.docker.com/desktop/setup/install/windows-install/'
exit 1
}
try { docker info *> $null } catch {
# En PS 5.1, *> $null sobre comandos nativos convierte stderr en errores
# terminantes con EAP=Stop (PS #4002). Se descarta via cmd /c.
if (-not (cmd /c "docker info >NUL 2>&1")) {
Err 'Docker Desktop no responde. Abre Docker Desktop y espera a que arranque.'
exit 1
}
try { docker compose version *> $null; $composeOk = $true } catch { $composeOk = $false }
# En PS 5.1, *> $null sobre comandos nativos convierte stderr en errores
# terminantes con EAP=Stop (PS #4002). Se descarta via cmd /c.
cmd /c "docker compose version >NUL 2>&1"
$composeOk = ($LASTEXITCODE -eq 0)
if (-not $composeOk) {
Err 'Docker Compose v2 no disponible. Actualiza Docker Desktop.'
exit 1
}
Ok "Docker: $(docker compose version --short 2>$null)"
Ok "Docker: $(cmd /c 'docker compose version --short 2>NUL')"
# --- Check RAM ------------------------------------------------------------
$TotalRamGb = [math]::Round((Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory / 1GB, 1)
@@ -116,7 +121,8 @@ if ($LASTEXITCODE -ne 0) { Err "docker compose up fallo (exit $LASTEXITCODE).";
Warn 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...'
$MaxWait = 60; $Waited = 0
while ($true) {
docker exec d0a1-ollama ollama ps *> $null
# Descarte de stderr via cmd /c (ver nota de PS 5.1 / PS #4002 arriba)
cmd /c "docker exec d0a1-ollama ollama ps >NUL 2>&1"
if ($LASTEXITCODE -eq 0) { break }
Start-Sleep -Seconds 2
$Waited += 2
+10 -4
View File
@@ -61,16 +61,21 @@ if (-not (Get-Command docker -ErrorAction SilentlyContinue)) {
Write-Host ' https://docs.docker.com/desktop/setup/install/windows-install/'
exit 1
}
try { docker info *> $null } catch {
# En PS 5.1, *> $null sobre comandos nativos convierte stderr en errores
# terminantes con EAP=Stop (PS #4002). Se descarta via cmd /c.
if (-not (cmd /c "docker info >NUL 2>&1")) {
Err 'Docker Desktop no responde. Abre Docker Desktop y espera a que arranque.'
exit 1
}
try { docker compose version *> $null; $composeOk = $true } catch { $composeOk = $false }
# En PS 5.1, *> $null sobre comandos nativos convierte stderr en errores
# terminantes con EAP=Stop (PS #4002). Se descarta via cmd /c.
cmd /c "docker compose version >NUL 2>&1"
$composeOk = ($LASTEXITCODE -eq 0)
if (-not $composeOk) {
Err 'Docker Compose v2 no disponible. Actualiza Docker Desktop.'
exit 1
}
Ok "Docker: $(docker compose version --short 2>$null)"
Ok "Docker: $(cmd /c 'docker compose version --short 2>NUL')"
# --- Check RAM ------------------------------------------------------------
$TotalRamGb = [math]::Round((Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory / 1GB, 1)
@@ -154,7 +159,8 @@ if ($LASTEXITCODE -ne 0) { Err "docker compose up fallo (exit $LASTEXITCODE).";
Warn 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...'
$MaxWait = 60; $Waited = 0
while ($true) {
docker exec d0a1-wp-ollama ollama ps *> $null
# Descarte de stderr via cmd /c (ver nota de PS 5.1 / PS #4002 arriba)
cmd /c "docker exec d0a1-wp-ollama ollama ps >NUL 2>&1"
if ($LASTEXITCODE -eq 0) { break }
Start-Sleep -Seconds 2
$Waited += 2