blob: ad9adf149c25c15df499e7baf4e5574cfd23ffe9 [file]
/-
Copyright (c) 2023 Lean FRO, LLC. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sebastian Ullrich
-/
module
prelude
public import Init.System.IO
public section
def Lean.determineLakePath : IO System.FilePath := do
if let some lakePath ← IO.getEnv "LAKE" then
return System.FilePath.mk lakePath
let sysroot? ← IO.getEnv "LEAN_SYSROOT"
match sysroot? with
| some sysroot => pure <| System.FilePath.mk sysroot / "bin" / "lake"
| none => pure <| (← IO.appDir) / "lake"