def source.ok

ezx@1.11.0.0 · src/ledger/render.bend:163

import ezx@1.11.0.0/src/ledger/render.bend as Render
import Base
import ezx@1.11.0.0/src/ledger/manifest.bend as M

163# whether a source reads back as itself. A git source names its repo and the
164# directory its paths are written from: the reader takes a section with no
165# `git` for a hub package and one with no `root` for the top of the checkout.
166# A workspace member's is `workspace = true`, with the directory and the name
167# only the joint ledger gives it.
168def source.ok(src: M.Source) -> Bool:
169  match src:
170    case M.Hub{+named}:
171      clean(named)
172    case M.Git{+url, rev, tag, +root, nar, _vend}:
173      Bool.and(Bool.and(Bool.not(String.is_empty(url)), Bool.not(String.is_empty(root))),
174        Bool.and(Bool.and(clean(url), clean(rev)),
175          Bool.and(clean(tag), Bool.and(clean(root), clean(nar)))))
176    case M.Member{+path, +named}:
177      Bool.and(clean(path), clean(named))

Uses (6)

Used by (2)