Skip to content

Commit bd78586

Browse files
snack-ableparkerziegler
authored andcommitted
Add OS check to determine whether or not to detach spawned child process.
1 parent cc7cef2 commit bd78586

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bin/webpack-dashboard.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const pkg = require("../package.json");
1717
const main = (module.exports = opts => {
1818
opts = opts || {};
1919
const argv = typeof opts.argv === "undefined" ? process.argv : opts.argv;
20+
const isWindows = process.platform === "win32";
2021

2122
program.version(pkg.version);
2223
program.option("-c, --color [color]", "Dashboard color");
@@ -43,7 +44,7 @@ const main = (module.exports = opts => {
4344
child = spawn(command, args, {
4445
env,
4546
stdio: [null, null, null, null],
46-
detached: true
47+
detached: !isWindows
4748
});
4849
}
4950

@@ -91,7 +92,7 @@ const main = (module.exports = opts => {
9192
});
9293

9394
process.on("exit", () => {
94-
process.kill(process.platform === "win32" ? child.pid : -child.pid);
95+
process.kill(isWindows ? child.pid : -child.pid);
9596
});
9697
} else {
9798
server.on("connection", socket => {

0 commit comments

Comments
 (0)