@@ -2,6 +2,7 @@ import { spawn } from 'child_process';
22import { setTimeout } from 'timers/promises' ;
33import { exec } from 'child_process' ;
44import { promisify } from 'util' ;
5+ import { getDebuggerStartCommand } from './getDebuggerStartCommand.js' ;
56
67export const execAsync = promisify ( exec ) ;
78
@@ -18,34 +19,8 @@ export async function startDebugger(folder: string, args: string[] = []) {
1819async function startDebuggerInternal ( folder : string , args : string [ ] = [ ] ) {
1920 console . log ( 'Starting LLD...' ) ;
2021
21- let testMonorepo = false ;
22- if ( process . env . TEST_MONOREPO === 'true' ) {
23- testMonorepo = true ;
24- // just the last two part of the folder
25- const folderParts = folder . split ( '/' ) ;
26- const testProjectFolder =
27- folderParts [ folderParts . length - 2 ] +
28- '/' +
29- folderParts [ folderParts . length - 1 ] ;
30- args . push ( `-m ${ testProjectFolder } ` ) ;
31- }
32-
33- if ( process . env . OBSERVABLE_MODE === 'true' ) {
34- args . push ( '-o' ) ;
35- }
36-
37- args . push ( '-v' ) ;
38-
39- let command = `node ${
40- testMonorepo ? '' : '../../'
41- } dist/lldebugger.mjs ${ args ?. join ( ' ' ) } `;
42-
43- if ( process . env . REAL_NPM === 'true' ) {
44- console . log ( 'Running the debugger with the real NPM' ) ;
45- command = `lld ${ args ?. join ( ' ' ) } ` ;
46- } else {
47- console . log ( 'Running the debugger with just genereted code' ) ;
48- }
22+ const testMonorepo = process . env . TEST_MONOREPO === 'true' ;
23+ const command = getDebuggerStartCommand ( folder , args ) ;
4924
5025 const lldProcess = spawn ( command , {
5126 cwd : ! testMonorepo ? folder : undefined ,
0 commit comments