This repository was archived by the owner on Feb 1, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,18 @@ const { spawn } = require('child_process');
2424const { EventEmitter } = require ( 'events' ) ;
2525const util = require ( 'util' ) ;
2626
27- const InspectClient = require ( './internal/inspect_client' ) ;
28- const createRepl = require ( './internal/inspect_repl' ) ;
27+ const [ InspectClient , createRepl ] =
28+ ( typeof __dirname !== 'undefined' ) ?
29+ // This copy of node-inspect is on-disk, relative paths make sense.
30+ [
31+ require ( './internal/inspect_client' ) ,
32+ require ( './internal/inspect_repl' )
33+ ] :
34+ // This copy of node-inspect is built into the node executable.
35+ [
36+ require ( 'node-inspect/lib/internal/inspect_client' ) ,
37+ require ( 'node-inspect/lib/internal/inspect_repl' )
38+ ] ;
2939
3040const debuglog = util . debuglog ( 'inspect' ) ;
3141
Original file line number Diff line number Diff line change 11'use strict' ;
22const spawn = require ( 'child_process' ) . spawn ;
33
4- const CLI = require . resolve ( '../../cli.js' ) ;
4+ const CLI =
5+ process . env . USE_EMBEDDED_NODE_INSPECT === '1' ?
6+ 'inspect' :
7+ require . resolve ( '../../cli.js' ) ;
58
69function startCLI ( args ) {
710 const child = spawn ( process . execPath , [ CLI , ...args ] ) ;
You can’t perform that action at this time.
0 commit comments