Skip to content

Commit 1d0f0e2

Browse files
committed
Minor readability changes
Forgot an s on line 7 and therefore lne 21. A friend pointed out that the "pipe" array is the default, but "inherit" automatically uses the parents process stdio.
1 parent b6f3688 commit 1d0f0e2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

livereload.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,19 @@ const { normalize } = require("path");
44

55
// 'disconnect' is not needed as it will only be raised, when either the child process or this process calss disconnect explicitly.
66
// We are abel to ensure, that this will never happen, as we do not need communication with the spawned subprocess
7-
const terminationSignal = ["close", "exit"];
7+
const terminationSignals = ["close", "exit"];
88

99
function startSubprocess() {
1010
return new Promise((res, rej) => {
1111
const [command, ...args] = process.argv.slice(2);
1212
const proc = spawn(normalize(command), args, {
13-
stdio: ["pipe", "pipe", "pipe"],
13+
// use parents stdio
14+
stdio: "inherit",
1415
shell:
1516
process.platform === "win32" ||
1617
/^(msys|cygwin)$/.test(process.env.OSTYPE),
1718
});
18-
proc.stdout.pipe(process.stdout);
19-
proc.stderr.pipe(process.stderr);
20-
process.stdin.pipe(proc.stdin);
21-
terminationSignal.forEach((event) => proc.on(event, res));
19+
terminationSignals.forEach((event) => proc.on(event, res));
2220
proc.on("error", rej);
2321
});
2422
}

0 commit comments

Comments
 (0)