def clone.weigh

ezx@1.11.0.0 · src/lock/run.bend:201

import ezx@1.11.0.0/src/lock/run.bend as Run
import Base
import snap@1.4.0.0/main.bend as R
import ezx@1.11.0.0/src/git/exec.bend as GX
import ezx@1.11.0.0/src/pkg/path.bend as P
import ezx@1.11.0.0/src/share/say.bend as Say
import ezx@1.11.0.0/src/share/spin.bend as Spin
import ezx@1.11.0.0/src/lock/world.bend as W

201# the checkout, weighed and walked
202def clone.weigh(+work: String, +url: String, +rev: String, +entry: String) -> IO(W.Answer):
203  do IO<W.Answer>:
204    _dg : String <- R.exec(["rm", "-rf", work ++ "/.git"])
205    +s : Say.Spin <- Spin.hold(Say.hashing(rev))
206    +nar : String <- GX.nar(work)
207    Spin.done(s)
208    +ck : String <- R.exec(["test", "-f", P.join(work, entry)])
209    clone.entry(R.ok(ck), work, entry, url, rev, nar)

Uses (16)

Used by (1)