def weigh

ezx@1.11.0.0 · src/git/exec.bend:62

import ezx@1.11.0.0/src/git/exec.bend as Exec
import Base
import snap@1.4.0.0/main.bend as R
import ezx@1.11.0.0/src/share/say.bend as Say
import ezx@1.11.0.0/src/share/spin.bend as Spin

62# the NAR hash of one commit. The checkout is weighed the way `fetchgit`
63# weighs it, then removed. Nothing is laid under BEND_LIB.
64def weigh(+url: String, +rev: String) -> IO(String):
65  +work = ".ez/weigh-" ++ rev
66  do IO<String>:
67    _rm : String <- R.exec(["rm", "-rf", work])
68    _mk : String <- R.exec(["mkdir", "-p", work])
69    clone(work, url, rev)
70    _dg : String <- R.exec(["rm", "-rf", work ++ "/.git"])
71    +s : Say.Spin <- Spin.hold(Say.hashing(rev))
72    +nh : String <- nar(work)
73    Spin.done(s)
74    _cl : String <- R.exec(["rm", "-rf", work])
75    return nh

Uses (14)

Used by (1)