diff --git a/index.js b/index.js index b797cd4..d08455f 100644 --- a/index.js +++ b/index.js @@ -58,8 +58,10 @@ function runCommand(command, stdin) { resolve(stdout); } }); - child.stdin.write(stdin); - child.stdin.end(); + if (stdin) { + child.stdin.write(stdin); + child.stdin.end(); + } }); }