1 # share/exec: a program run with this project's BEND_LIB in front of it, and 2 # the directories bend writes into made before it starts. share/env decides 3 # what the line and the directories are; this runs them, through snap's 4 # foreign effect, and lives apart because bend 2.0.32 fails a proof whose 5 # imports reach foreign code, so a law may import share/env but never this. 6 import Base 7 import 0x8e26a6f8c31689519e618374376ee3dd/main.bend as R 8 import ./env.bend as Env 9 10 # a program run with this project's BEND_LIB set for it 11 def exec(args: List<&2, String>) -> IO(String): 12 do IO: 13 at : String <- Env.lib() 14 R.exec(Env.line(at, args)) 15 16 # those directories made. Base has no mkdir, so this is coreutils, and no 17 # directory means no run at all. 18 def make(ds: List<&2, String>) -> IO(Unit): 19 match ds: 20 case []: 21 IO.pure(Unit, Unit{}) 22 case h <> t: 23 do IO: 24 _mk : String <- R.exec(List.append(&2, String, ["mkdir", "-p"], h <> t)) 25 return Unit{}