def whole.read

ezx@1.11.0.0 · src/lock/run.bend:463

import ezx@1.11.0.0/src/lock/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/pkg/pkg.bend as K

463# every listed file of the checkout, read, with its path from the checkout's
464# top. One that cannot be read as text, such as a link to a directory, is
465# left out, as the walk would find it missing.
466def whole.read(+work: String, ps: List<&2, String>) -> IO(List<&2, K.Source>):
467  match ps:
468    case []:
469      IO.pure(List<&2, K.Source>, [])
470    case +h <> t:
471      do IO<List<&2, K.Source>>:
472        m : Maybe<&2, String> <- F.read(h)
473        rest : List<&2, K.Source> <- whole.read(work, t)
474        return whole.put(m, String.drop(h, (1n + String.length(work) : Nat)), rest)

Uses (13)

Used by (1)