def fetch.ask

ezx@1.11.0.0 · src/fetch/plan.bend:57

import ezx@1.11.0.0/src/fetch/plan.bend as Plan
import Base
import ezx@1.11.0.0/src/fetch/world.bend as F
import ezx@1.11.0.0/src/lock/world.bend as W
import ezx@1.11.0.0/src/lock/up.bend as Up
import ezx@1.11.0.0/src/lock/lock.bend as L
import ezx@1.11.0.0/src/pkg/path.bend as Path

57# the question that fetches a package from where the lock says it comes from:
58# a checkout of a git package at its rev, from its source as git is to read
59# it, a relative path taken from the project; or a hub package from the hub
60def fetch.ask(src: L.Src, +here: String, +hub: String, +hash: String) -> F.Ask:
61  match src:
62    case L.Hub{}:
63      F.Hub{W.Pkg{hash, L.Hub{}, hub}}
64    case L.Git{url, rev, _entry, _root, _nar, _tag}:
65      F.Git{hash, Up.Clone{Path.anchor(here, url), rev}}
66    case L.Member{_path, entry}:
67      F.Tree{hash, entry}

Uses (6)

Used by (2)