Run.rooted: def of ezx@1.11.0.0 Import: import ezx@1.11.0.0/src/ws/run.bend as Run Lines 374-384 of ezx@1.11.0.0/src/ws/run.bend: https://jend.leeeet.dev/read.txt?path=ezx@1.11.0.0/src/ws/run.bend&start_line=374&end_line=384 import Base import snap@1.4.0.0/main.bend as Sn import ezx@1.11.0.0/src/io/file.bend as F import ezx@1.11.0.0/src/ws/joint.bend as J import ezx@1.11.0.0/src/lock/world.bend as LW import ezx@1.11.0.0/src/ws/relock.bend as Rel # what a command run at `rel` from the root at `at` reads of the root: its # ledger, every ez.toml and `.bend` file git lists under it, and its lock def rooted(+at: String, rel: List<&2, String>) -> IO(Rel.Rooted): do IO: mm : Maybe<&2, String> <- F.read(at ++ "/ez.toml") +out : String <- Sn.exec(["git", "-C", at, "-c", "core.quotepath=off", "ls-files", "--", ":(glob)**/ez.toml"]) fs : List<&2, J.Found> <- read.under(at, lines(String.lines(Sn.text(out)))) ls : LW.Listing <- listing.at(at) lk : Maybe<&2, String> <- F.read(at ++ "/ez.lock.toml") return Rel.Rooted{at, rel, F.text_of(mm), fs, ls, F.text_of(lk)} Uses (18): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.lines https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/io/file.bend&name=read https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/io/file.bend&name=text_of https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/lock/world.bend&name=Listing https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ws/joint.bend&name=Found https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ws/relock.bend&name=Rooted https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ws/run.bend&name=lines https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ws/run.bend&name=listing.at https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ws/run.bend&name=read.under https://jend.leeeet.dev/definition.txt?path=snap@1.4.0.0/main.bend&name=exec https://jend.leeeet.dev/definition.txt?path=snap@1.4.0.0/main.bend&name=text