Skip to content

Commit a3ad916

Browse files
committed
Enable stdin piping
1 parent 9fbc8b0 commit a3ad916

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

widip/watch.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def widish_main(file_name, *shell_program_args: str):
7575
diagram_draw(path, fd)
7676
constants = tuple(x.name for x in fd.dom)
7777
runner = SHELL_RUNNER(fd)(*constants)
78-
# TODO pass stdin
79-
run_res = runner and runner("")
78+
79+
run_res = runner("") if sys.stdin.isatty() else runner(sys.stdin.read())
80+
8081
print(*(tuple(x.rstrip() for x in tuplify(untuplify(run_res)) if x)), sep="\n")

0 commit comments

Comments
 (0)