fix: make sure logs folder exists

This commit is contained in:
Chris Lovett 2021-09-15 19:09:36 -07:00 committed by Sebastian Ullrich
parent 8d370f151f
commit d32b4ffb24

View file

@ -84,6 +84,7 @@ def maybeTee (fName : String) (isOut : Bool) (h : FS.Stream) : IO FS.Stream := d
match (← IO.getEnv "LEAN_SERVER_LOG_DIR") with
| none => pure h
| some logDir =>
IO.FS.createDirAll logDir
let hTee ← FS.Handle.mk (System.mkFilePath [logDir, fName]) FS.Mode.write true
let hTee := FS.Stream.ofHandle hTee
pure $ if isOut then