refactor: lake: log process output as info on errors (#13151)

This PR changes `Lake.proc` to always log process output as `info` if
the process exits with a nonzero return code. This way it behaves the
same as `captureProc` on errors.
This commit is contained in:
Mac Malone 2026-03-27 12:49:14 -04:00 committed by GitHub
parent 088b299343
commit d0d135dbe2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -36,8 +36,10 @@ public def mkCmdLog (args : IO.Process.SpawnArgs) : String :=
public def proc (args : IO.Process.SpawnArgs) (quiet := false) : LogIO Unit := do
withLogErrorPos do
let out ← rawProc args
logOutput out (if quiet then logVerbose else logInfo)
if out.exitCode ≠ 0 then
if out.exitCode = 0 then
logOutput out (if quiet then logVerbose else logInfo)
else
logOutput out logInfo
error s!"external command '{args.cmd}' exited with code {out.exitCode}"
public def captureProc' (args : IO.Process.SpawnArgs) : LogIO (IO.Process.Output) := do