bwbox/lib/bwrap.nim

19 lines
499 B
Nim
Raw Normal View History

2022-05-12 17:51:55 +02:00
import os
2021-05-18 20:39:59 +02:00
import posix
import sequtils
type BwrapCall* = object
2021-12-27 16:39:18 +01:00
args*: seq[string]
2021-05-18 20:39:59 +02:00
proc addArg*(call: var BwrapCall, args: varargs[string]): var BwrapCall {.discardable.} =
for arg in args:
call.args.add(arg)
call
proc addMount*(call: var BwrapCall, mType: string, path: string): var BwrapCall {.discardable.} =
addArg(call, mType, path, path)
call
proc exec*(call: var BwrapCall) =
2022-05-12 17:51:55 +02:00
discard execv("/usr/bin/env", allocCStringArray(@["/usr/bin/env", "bwrap"].concat(call.args)))