def plan.new

ezx@1.11.0.0 · src/init/plan.bend:227

import ezx@1.11.0.0/src/init/plan.bend as Plan
import Base
import ezx@1.11.0.0/src/lock/plan.bend as P

227# the new project's files, once it fits. A name or entry the ledger cannot
228# carry, such as one holding a quote, or a description holding a newline, is
229# refused with no effect at all.
230def plan.new(
231  ok: Bool,
232  +name: String,
233  +at: String,
234  +desc: String,
235  ignore: Maybe<&2, String>,
236  main: Maybe<&2, String>,
237  lib: Maybe<&2, String>
238) -> P.Plan:
239  match ok:
240    case True{}:
241      +text = text.of(ignore)
242      P.Plan{P.Write{toml(), fresh(name, at)} <>
243        ignore.put(missing(rules(name), String.lines(text)), text,
244          files(name, at, desc, main, lib)), P.Success{}}
245    case False{}:
246      P.Plan{[], P.Refused{why.unfit(name, at)}}

Uses (16)

Used by (1)