Run.answer.clone: def of ezx@1.11.0.0 Import: import ezx@1.11.0.0/src/lock/run.bend as Run Lines 211-226 of ezx@1.11.0.0/src/lock/run.bend: https://jend.leeeet.dev/read.txt?path=ezx@1.11.0.0/src/lock/run.bend&start_line=211&end_line=226 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 import ezx@1.11.0.0/src/lock/world.bend as W # a git package whose tree is not under BEND_LIB: a shallow clone at the rev # the ledger pins, the way `ez add` and `ez fetch` clone, from the source the # question names, which the planner anchored at the project root. Nothing is # laid here; the plan lays the tree once it has checked it. def answer.clone(+lib: String, +hash: String, +url: String, +rev: String, +entry: String) -> IO(W.Answer): +work = lib ++ "/.work-" ++ hash do IO: _rm : String <- R.exec(["rm", "-rf", work]) _mk : String <- R.exec(["mkdir", "-p", work]) +s : Say.Spin <- Spin.hold(Say.dep.git(Say.label(hash, entry), url)) a : W.Answer <- clone.run(work, "init", ["git", "init", "-q", work], _u => clone.run(work, "fetch", ["git", "-C", work, "fetch", "-q", "--depth", "1", url, rev], _v => clone.run(work, "checkout", ["git", "-C", work, "checkout", "-q", rev], _w => clone.weigh(work, url, rev, entry)))) Spin.done(s) return a Uses (16): 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/lock/run.bend&name=clone.run https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/lock/run.bend&name=clone.weigh https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/lock/world.bend&name=Answer 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=dep.git https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/share/say.bend&name=label 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