def plan.read

ezx@1.11.0.0 · src/remove/plan.bend:159

import ezx@1.11.0.0/src/remove/plan.bend as Plan
import Base
import ezx@1.11.0.0/src/lock/plan.bend as P
import ezx@1.11.0.0/src/ledger/manifest.bend as M
import ezx@1.11.0.0/src/ledger/render.bend as Rend

159# the plan for the ledger as read. One that did not read, or is not there,
160# is refused before anything else, and its reason is the one every command
161# that edits a ledger gives.
162def plan.read(led: M.Read, +name: String, +ignore: String) -> P.Plan:
163  match led:
164    case M.Bad{why}:
165      P.Plan{[], P.Refused{"ez: " ++ M.show(M.Bad{why})}}
166    case M.Good{+m}:
167      plan.has(Bool.and(named(deps.of(m), name), Rend.renderable(Rend.remove(m, name))),
168        m, name, ignore)

Uses (13)

Used by (1)