def tool.pairs

ezx@1.11.0.0 · src/lock/lock.bend:558

import ezx@1.11.0.0/src/lock/lock.bend as Lock
import Base
import ezx@1.11.0.0/src/toml/toml.bend as T
import ezx@1.11.0.0/src/ledger/manifest.bend as M

558# the keys a pinned CLI contributes. The same names a `[tools.*]` section
559# uses in ez.toml, and not the `[packages.*]` source table.
560def tool.pairs(+entry: String, +binary: String, source: M.Source) -> List<&2, T.Kv>:
561  match source:
562    case M.Hub{_named}:
563      List.concat(&2, T.Kv, [kv("entry", entry), kv("bin", binary)])
564    case M.Git{url, rev, tag, root, nar, _vend}:
565      List.concat(&2, T.Kv,
566        [kv("git", url), kv("rev", rev), kv("tag", tag), kv("root", root),
567         kv("narHash", nar), kv("entry", entry), kv("bin", binary)])
568    case M.Member{_path, _named}:
569      List.concat(&2, T.Kv, [kv("entry", entry), kv("bin", binary)])

Uses (6)

Used by (1)