Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.

Commit 8ef696d

Browse files
authored
Merge pull request #43 from ofrobots/inspect-brk
Prefer --inspect-brk over --debug-brk
2 parents f4ff6ae + 2c1ed27 commit 8ef696d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/_inspect.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,11 @@ function runScript(script, scriptArgs, inspectHost, inspectPort, childPrint) {
9696
return portIsFree(inspectHost, inspectPort)
9797
.then(() => {
9898
return new Promise((resolve) => {
99-
const args = [
100-
'--inspect',
101-
`--debug-brk=${inspectPort}`,
102-
].concat([script], scriptArgs);
99+
const needDebugBrk = process.version.match(/^v(6|7)\./);
100+
const args = (needDebugBrk ?
101+
['--inspect', `--debug-brk=${inspectPort}`] :
102+
[`--inspect-brk=${inspectPort}`])
103+
.concat([script], scriptArgs);
103104
const child = spawn(process.execPath, args);
104105
child.stdout.setEncoding('utf8');
105106
child.stderr.setEncoding('utf8');

0 commit comments

Comments
 (0)