def seed.of

ezx@1.11.0.0 · src/add/relock.bend:65

import ezx@1.11.0.0/src/add/relock.bend as Relock
import Base
import ezx@1.11.0.0/src/lock/world.bend as W
import ezx@1.11.0.0/src/lock/lock.bend as L
import ezx@1.11.0.0/src/pkg/pkg.bend as K

65# the package a walk made, as the answer to the lock's question about its
66# hash: its manifest and the text of each file it names, read as a tree under
67# BEND_LIB, which is where the add lays it. The lock checks it as it checks
68# any tree there. A walk that made no package answers nothing.
69def seed.of(walk: K.Walked) -> List<&2, W.Reply>:
70  match walk:
71    case K.Walked{h, _root, +fs, ss}:
72      +manifest = K.manifest_of(ss)
73      [W.Reply{W.Pkg{h, L.Hub{}, ""},
74        W.Got{W.Lib{}, manifest, texts(fs, L.manifest.files(String.lines(manifest)))}}]
75    case K.Asks{_at}:
76      []
77    case K.Refused{_why}:
78      []

Uses (11)

Used by (1)