def hub.why

ezx@1.11.0.0 · src/ez/named.bend:247

import ezx@1.11.0.0/src/ez/named.bend as Named
import Base
import ezx@1.11.0.0/src/ledger/manifest.bend as M

247# why a hub package cannot be recorded under a name, or nothing when it can:
248# a `--rename` that is no key, a `--rename` of a name part the ledger records
249# under another name, or a name the ledger gives another source
250def hub.why(+ds: List<&2, M.Dep>, +name: String, +part: String, +rename: String) -> String:
251  +old = hub.had(ds, part)
252  Bool.pick(String, renamed.ok(rename),
253    Bool.pick(String, moved.of(old, rename),
254      "ez: " ++ part ++ " is already recorded as deps." ++ old ++
255        "; remove it first to record it as " ++ rename,
256      Bool.pick(String, hub.clash(ds, name, part),
257        "ez: ez.toml already has a deps." ++ name ++ " from another source; " ++
258          "remove it first, or add this one with --rename",
259        "")),
260    "ez: --rename " ++ rename ++ " is not a TOML bare key " ++
261      "(letters, digits, `-` and `_`)")

Uses (9)

Used by (1)