def anchor.src

ezx@1.11.0.0 · src/lock/plan.bend:1144

import ezx@1.11.0.0/src/lock/plan.bend as Plan
import Base
import ezx@1.11.0.0/src/lock/lock.bend as L
import ezx@1.11.0.0/src/pkg/path.bend as Path

1144# a package's source as git is to read it: a path anchored at the directory
1145# the lock runs in (`Path.anchor`), and a URL or an absolute path as it is. A
1146# hub package names no source. The lock records the source as the ledger
1147# gives it; only the question carries this.
1148def anchor.src(+here: String, src: L.Src) -> L.Src:
1149  match src:
1150    case L.Hub{}:
1151      L.Hub{}
1152    case L.Git{url, rev, entry, root, nar, tag}:
1153      L.Git{Path.anchor(here, url), rev, entry, root, nar, tag}
1154    case L.Member{path, entry}:
1155      L.Member{path, entry}

Uses (3)

Used by (1)