src/remove/run.bend
ezx@1.6.0.0 · 17 lines · 0 definitions
1# remove/run: the interpreter for `ez remove`. It reads ez.toml and
2# `.gitignore` into a World, asks the planner (remove/plan.bend) for the plan,
3# and runs it with the lock's effect runner (`Run.exec.plan`), which exits 1
4# with the reason when the plan refuses. It decides nothing; that it reads and
5# executes faithfully is EZ-TRUST-2.
6import Base
7import ezx@1.6.0.0/src/io/file.bend as F
8import ezx@1.6.0.0/src/lock/run.bend as Run
9import ezx@1.6.0.0/src/remove/plan.bend as RP
10
11# `ez remove <name>`
12def run(+name: String) -> IO(Unit):
13 do IO<Unit>:
14 lib : String <- Run.bend.lib()
15 led : Maybe<&2, String> <- F.read(RP.toml())
16 ig : Maybe<&2, String> <- F.read(RP.ignore.file())
17 Run.exec.plan(lib, RP.plan(RP.World{name, led, F.text_of(ig)}))