fix(ts/index): Use cli.js as the spawned CLI entry point instead of cli.child.js
This commit is contained in:
10
ts/index.ts
10
ts/index.ts
@@ -98,13 +98,13 @@ export const runCli = async (pathArg?: string, options?: IRunOptions) => {
|
||||
const runInChildProcess = async (pathArg: string | undefined, cwd: string): Promise<void> => {
|
||||
const { spawn } = await import('child_process');
|
||||
|
||||
// Resolve cli.child.js relative to this file
|
||||
const cliChildPath = plugins.path.join(__dirname, '../cli.child.js');
|
||||
// Resolve cli.js relative to this file
|
||||
const cliPath = plugins.path.join(__dirname, '../cli.js');
|
||||
|
||||
// Build args: [Node flags, entry point, script path, script args]
|
||||
const args = [
|
||||
...process.execArgv, // Preserve --inspect, etc.
|
||||
cliChildPath,
|
||||
cliPath,
|
||||
...process.argv.slice(2) // Original CLI args (not spliced)
|
||||
];
|
||||
|
||||
@@ -172,10 +172,10 @@ export const spawnPath = (
|
||||
: filePath;
|
||||
|
||||
// 2. Build spawn args
|
||||
const cliChildPath = plugins.path.join(__dirname, '../cli.child.js');
|
||||
const cliPath = plugins.path.join(__dirname, '../cli.js');
|
||||
const args = [
|
||||
...process.execArgv,
|
||||
cliChildPath,
|
||||
cliPath,
|
||||
resolvedPath,
|
||||
...(options?.args || [])
|
||||
];
|
||||
|
Reference in New Issue
Block a user