def located

ezx@1.11.0.0 · src/tool/run.bend:97

import ezx@1.11.0.0/src/tool/run.bend as Run
import Base
import snap@1.4.0.0/main.bend as R
import ezx@1.11.0.0/src/tool/world.bend as TW

97# what git says of a path that has a real path: the top of its checkout,
98# HEAD, and what `git status` names, untracked files included whatever the
99# repository's own settings hide
100def located(+abs: String) -> IO(TW.Answer):
101  do IO<TW.Answer>:
102    +top : String <- R.exec(["git", "-C", abs, "rev-parse", "--show-toplevel"])
103    +head : String <- R.exec(["git", "-C", abs, "rev-parse", "HEAD"])
104    +st : String <- R.exec(["git", "-C", abs, "status", "--porcelain",
105      "--untracked-files=normal"])
106    return TW.Located{abs, said.top(top), said.head(head), R.ok(st),
107      String.trim(R.text(st))}

Uses (12)

Used by (1)