doug/lakefile.lean

32 lines
755 B
Text
Raw Normal View History

2024-10-20 16:17:37 +09:00
import Lake
open Lake DSL
meta if get_config? env = some "dev" then -- dev is so not everyone has to build it
require "leanprover" / "doc-gen4"
2024-10-20 16:17:37 +09:00
package "doug" where
version := v!"0.1.0"
lean_lib «Doug» where
-- add library configuration options here
@[default_target]
lean_exe "doug" where
root := `Main
/--
Doug
-/
script test (args) do
let exe := (← doug.get).file
IO.println s!"exe: {exe}"
IO.println s!"args: {args}"
let proc ← IO.Process.spawn
⟨{stdin := .inherit, stdout := .piped, stderr := .piped},
exe.toString, args.toArray, none, #[], false ⟩
IO.print (← proc.stdout.readToEnd)
IO.eprintln (← IO.FS.Handle.readToEnd proc.stderr)
let ret ← proc.wait
IO.println s!"returned: {ret}"
pure ret