tzk/tw.py
Soren I. Bjornstad b61ff148ed add listen command
2021-08-25 15:25:50 -05:00

12 lines
393 B
Python

import subprocess
from typing import Sequence
def exec(args: Sequence[Sequence[str]]) -> None:
bin_dir = subprocess.check_output(("npm", "bin"), text=True).strip()
call_args = [bin_dir + "/tiddlywiki"]
for tw_arg in args:
call_args.append(f"--{tw_arg[0]}")
for inner_arg in tw_arg[1:]:
call_args.append(inner_arg)
return subprocess.call(call_args)