doug/lakefile.lean
qwjyh 244ace87c3
Some checks failed
Lean Action CI / build (push) Has been cancelled
argument for starting directory (completed)
2024-10-23 14:31:20 +09:00

31 lines
755 B
Text

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"
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