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:
parent
088b299343
commit
d0d135dbe2
1 changed files with 4 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue