def whole.dir
ezx@1.11.0.0 · src/lock/run.bend:503
import ezx@1.11.0.0/src/lock/run.bend as Run
import Base
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
503
504def whole.dir(ok: Bool, +work: String, +url: String, +rev: String) -> IO(Up.Answer):
505 match ok:
506 case False{}:
507 IO.pure(Up.Answer, Up.Miss{"ez: no scratch directory to clone into: " ++ work})
508 case True{}:
509 do IO<Up.Answer>:
510 +s : Say.Spin <- Spin.hold(Say.git.fetch(url))
511 a : Up.Answer <- whole.run(work, "init", ["git", "init", "-q", work], _u =>
512 whole.run(work, "fetch", ["git", "-C", work, "fetch", "-q", "--depth", "1", url, rev], _v =>
513 whole.run(work, "checkout", ["git", "-C", work, "checkout", "-q", rev], _w =>
514 whole.weigh(work, rev))))
515 Spin.done(s)
516 return a