def rooted

ezx@1.11.0.0 · src/ws/run.bend:374

import ezx@1.11.0.0/src/ws/run.bend as Run
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

374# what a command run at `rel` from the root at `at` reads of the root: its
375# ledger, every ez.toml and `.bend` file git lists under it, and its lock
376def rooted(+at: String, rel: List<&2, String>) -> IO(Rel.Rooted):
377  do IO<Rel.Rooted>:
378    mm : Maybe<&2, String> <- F.read(at ++ "/ez.toml")
379    +out : String <- Sn.exec(["git", "-C", at, "-c", "core.quotepath=off", "ls-files", "--",
380      ":(glob)**/ez.toml"])
381    fs : List<&2, J.Found> <- read.under(at, lines(String.lines(Sn.text(out))))
382    ls : LW.Listing <- listing.at(at)
383    lk : Maybe<&2, String> <- F.read(at ++ "/ez.lock.toml")
384    return Rel.Rooted{at, rel, F.text_of(mm), fs, ls, F.text_of(lk)}

Uses (18)

Used by (1)