-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
executable file
·42 lines (36 loc) · 909 Bytes
/
Copy pathindex.js
File metadata and controls
executable file
·42 lines (36 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env node
var fs = require('fs');
var nodeInspector = require('node-inspector/lib/debug-server');
var cp = require('child_process');
var args = [
'--debug-brk',
'node_modules/jasmine/bin/jasmine.js'
];
if (process.argv.length > 2) {
args.push.apply(args, process.argv.slice(2));
}
args.forEach(function(arg) {
if (!/\.js$/.test(arg)) {
return;
}
if (!fs.existsSync(arg)) {
console.log("Could not find js file: " + arg);
process.exit(1);
}
});
var config = {
"webPort": 8282,
"webHost": null,
"debugPort": 5858,
"saveLiveEdit": false,
"hidden": []
};
var debugServer = new nodeInspector.DebugServer();
debugServer.on('close', function() {
console.log('debugger closed!');
process.exit();
});
debugServer.start(config);
cp.spawn('node', args);
var url = "http://localhost:" + config.webPort + "/debug?port=" + config.debugPort;
console.log("Open:", url);