Exec.weigh: def of ezx@1.11.0.0 Import: import ezx@1.11.0.0/src/git/exec.bend as Exec Lines 62-75 of ezx@1.11.0.0/src/git/exec.bend: https://jend.leeeet.dev/read.txt?path=ezx@1.11.0.0/src/git/exec.bend&start_line=62&end_line=75 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 # the NAR hash of one commit. The checkout is weighed the way `fetchgit` # weighs it, then removed. Nothing is laid under BEND_LIB. def weigh(+url: String, +rev: String) -> IO(String): +work = ".ez/weigh-" ++ rev do IO: _rm : String <- R.exec(["rm", "-rf", work]) _mk : String <- R.exec(["mkdir", "-p", work]) clone(work, url, rev) _dg : String <- R.exec(["rm", "-rf", work ++ "/.git"]) +s : Say.Spin <- Spin.hold(Say.hashing(rev)) +nh : String <- nar(work) Spin.done(s) _cl : String <- R.exec(["rm", "-rf", work]) return nh Uses (14): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/git/exec.bend&name=clone https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/git/exec.bend&name=nar https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/share/say.bend&name=Spin https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/share/say.bend&name=hashing https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/share/spin.bend&name=done https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/share/spin.bend&name=hold https://jend.leeeet.dev/definition.txt?path=snap@1.4.0.0/main.bend&name=exec