diff --git a/shlax/actions/run.py b/shlax/actions/run.py index 4bb5036..3fc561c 100644 --- a/shlax/actions/run.py +++ b/shlax/actions/run.py @@ -1,11 +1,15 @@ class Run: - def __init__(self, cmd): + def __init__(self, cmd, root=False): self.cmd = cmd + self.root = root async def __call__(self, target): - self.proc = await target.exec(self.cmd) + if self.root: + self.proc = await target.rexec(self.cmd) + else: + self.proc = await target.exec(self.cmd) def __str__(self): return f'Run({self.cmd})'