From 50f794d6459d11986db2d0d85e68092733435c24 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Tue, 14 May 2024 10:22:40 -0600 Subject: [PATCH] feat: use spawn instead of fork --- src/fork.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fork.ts b/src/fork.ts index c06bcebd..e011cb5f 100644 --- a/src/fork.ts +++ b/src/fork.ts @@ -20,11 +20,13 @@ const debug = makeDebug('@oclif/plugin-plugins:fork') export async function fork(modulePath: string, args: string[] = [], {cwd, logLevel}: ExecOptions): Promise { return new Promise((resolve, reject) => { // On windows, the global path to npm could be .cmd, .exe, or .js. If it's a .js file, we need to run it with node. - if (modulePath.endsWith('.js')) { + if (process.platform === 'win32' && modulePath.endsWith('.js')) { args.unshift(`"${modulePath}"`) modulePath = 'node' } + debug('modulePath', modulePath) + debug('args', args) const forked = spawn(modulePath, args, { cwd, env: {