From c8e0f2e5eda6a57b50a658ef4d04a8f15a104d14 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Sat, 12 Sep 2026 19:32:36 +0200 Subject: [PATCH] fix: docker check usaba -not sobre output vacio en vez de LASTEXITCODE if (-not (cmd /c ...)) comprueba el OUTPUT (siempre vacio con >NUL), no el exit code: en Windows el script entraba en la rama de error aunque Docker estuviera OK. Detectado en smoke test con pwsh 7.4.6. --- hermes/deploy.ps1 | 3 ++- openclaw/deploy.ps1 | 3 ++- openwebui/deploy.ps1 | 3 ++- wordpress/deploy.ps1 | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hermes/deploy.ps1 b/hermes/deploy.ps1 index 260e145..e1a268b 100644 --- a/hermes/deploy.ps1 +++ b/hermes/deploy.ps1 @@ -65,7 +65,8 @@ if (-not (Get-Command docker -ErrorAction SilentlyContinue)) { } # 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")) { +$null = cmd /c "docker info >NUL 2>&1" +if ($LASTEXITCODE -ne 0) { Err 'Docker Desktop no responde. Abre Docker Desktop y espera a que arranque.' exit 1 } diff --git a/openclaw/deploy.ps1 b/openclaw/deploy.ps1 index 86c00d0..fb82875 100644 --- a/openclaw/deploy.ps1 +++ b/openclaw/deploy.ps1 @@ -65,7 +65,8 @@ if (-not (Get-Command docker -ErrorAction SilentlyContinue)) { } # 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")) { +$null = cmd /c "docker info >NUL 2>&1" +if ($LASTEXITCODE -ne 0) { Err 'Docker Desktop no responde. Abre Docker Desktop y espera a que arranque.' exit 1 } diff --git a/openwebui/deploy.ps1 b/openwebui/deploy.ps1 index b1a725a..ba07b25 100644 --- a/openwebui/deploy.ps1 +++ b/openwebui/deploy.ps1 @@ -63,7 +63,8 @@ if (-not (Get-Command docker -ErrorAction SilentlyContinue)) { } # 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")) { +$null = cmd /c "docker info >NUL 2>&1" +if ($LASTEXITCODE -ne 0) { Err 'Docker Desktop no responde. Abre Docker Desktop y espera a que arranque.' exit 1 } diff --git a/wordpress/deploy.ps1 b/wordpress/deploy.ps1 index 9608df3..bb2f4c3 100644 --- a/wordpress/deploy.ps1 +++ b/wordpress/deploy.ps1 @@ -63,7 +63,8 @@ if (-not (Get-Command docker -ErrorAction SilentlyContinue)) { } # 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")) { +$null = cmd /c "docker info >NUL 2>&1" +if ($LASTEXITCODE -ne 0) { Err 'Docker Desktop no responde. Abre Docker Desktop y espera a que arranque.' exit 1 } -- 2.54.0