def read.ups

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

import ezx@1.11.0.0/src/ws/run.bend as Run
import Base
import ezx@1.11.0.0/src/io/file.bend as F
import ezx@1.11.0.0/src/ws/root.bend as R

35# the ez.toml of every directory the search asks about, nearest first
36def read.ups(+top: String, asks: List<&2, R.Ask>) -> IO(List<&2, R.Up>):
37  match asks:
38    case []:
39      IO.pure(List<&2, R.Up>, [])
40    case R.Ask{+ds, rs} <> tl:
41      do IO<List<&2, R.Up>>:
42        tx : Maybe<&2, String> <- F.read(ledger.path(top, ds))
43        rest : List<&2, R.Up> <- read.ups(top, tl)
44        return R.Up{ds, rs, tx} <> rest

Uses (10)

Used by (1)