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 ------------------------------------------------------------