Run.answer.tree: def of ezx@1.11.0.0 Import: import ezx@1.11.0.0/src/lock/run.bend as Run Lines 359-375 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=359&end_line=375 import Base import snap@1.4.0.0/main.bend as R import ezx@1.11.0.0/src/git/git.bend as Git 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/up.bend as Up # a checkout at a rev: cloned, its `.git` removed, weighed, and walked. An # entry that was not recorded is read from the checkout. Nothing is laid and # nothing is noted: a tree the upgrade moves to is laid by the plan, once the # upgrade and the lock both succeed. def answer.tree(+lib: String, +url: String, +rev: String, +entry: String) -> IO(Up.Answer): +work = lib ++ "/.work-" ++ rev do IO: _rm : String <- R.exec(["rm", "-rf", work]) _mk : String <- R.exec(["mkdir", "-p", work]) GX.clone(work, url, rev) +at : String <- Git.entry.for(Bool.not(String.is_empty(entry)), entry, work) _dg : String <- R.exec(["rm", "-rf", work ++ "/.git"]) +s : Say.Spin <- Spin.hold(Say.hashing(rev)) +nar : String <- GX.nar(work) Spin.done(s) +ck : String <- R.exec(["test", "-f", P.join(work, at)]) tree.entry(R.ok(ck), work, at, url, rev, nar) Uses (20): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not 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=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=String.is_empty 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/git/git.bend&name=entry.for https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/lock/run.bend&name=tree.entry https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/lock/up.bend&name=Answer https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/pkg/path.bend&name=join 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 https://jend.leeeet.dev/definition.txt?path=snap@1.4.0.0/main.bend&name=ok