def lib.at

ezx@1.11.0.0 · src/ws/run.bend:243

import ezx@1.11.0.0/src/ws/run.bend as Run
import Base
import snap@1.4.0.0/main.bend as Sn
import ezx@1.11.0.0/src/ws/hop.bend as H

243# a command acted on as the library decision says: where it is, or again
244# where it is with BEND_LIB set to the root's
245def lib.at(lib: H.Lib, go: Unit -> IO(Unit)) -> IO(Unit):
246  match lib:
247    case H.Keep{}:
248      go(Unit{})
249    case H.Set{+at}:
250      do IO<Unit>:
251        +pwd : String <- Sn.exec(["pwd"])
252        xs : List<&2, String> <- argv()
253        +code : U32 <- lib.go(at, String.trim(Sn.text(pwd)), xs)
254        hop.end(U32.is_eq(code, 0), code)

Uses (14)

Used by (1)