fix: don't use fork with node inspect

Fixes: #1191
This commit is contained in:
Remy Sharp
2017-12-28 20:16:30 +00:00
parent 0c78a9c7a0
commit 27443efe65

View File

@@ -78,10 +78,13 @@ function run(options) {
});
}
const firstArg = cmd.args[0] || '';
if (
// this is a hack to avoid forking if there's a node argument being passed
// it's a short term fix, and I'm not 100% sure that `fork` is the right way
(cmd.args[0] || '').indexOf('-') === -1 &&
firstArg.indexOf('-') === -1 &&
firstArg !== 'inspect' &&
executable === 'node' &&
utils.version.major > 4
) {