From 1c986946f453c1030f0406061124ebb073d71c04 Mon Sep 17 00:00:00 2001 From: Renaud Heluin Date: Mon, 30 Sep 2024 20:48:56 +0200 Subject: [PATCH] fix: path win32 --- src/main/handlers/HandleCollectAll.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/handlers/HandleCollectAll.ts b/src/main/handlers/HandleCollectAll.ts index 0de2aab..edb2877 100644 --- a/src/main/handlers/HandleCollectAll.ts +++ b/src/main/handlers/HandleCollectAll.ts @@ -60,7 +60,7 @@ export async function _prepareCollect(): Promise<{ if (os.platform() === `win32`) { nodeDir = nodeDir.replace(/\\/gm, path.sep) - scriptPath = scriptPath.replace(/\\/gm, path.sep) + scriptPath = scriptPath.replace(/\\/gm, `\\\\`) } const command = [scriptPath, 'collect'] mainLog.log(`command`, command) // change to debug @@ -95,16 +95,16 @@ export async function _runCollect( let childProcess: ChildProcess if (useSpawn) { + const [script, ...args] = command _debugLogs( - `runCollect: ${nodeDir} ${JSON.stringify(command, null, 2)}` + `runCollect: nodeDir: ${nodeDir}; script: ${script}; args: ${JSON.stringify(args, null, 2)}` ) - const [script, ...args] = command childProcess = spawn( // `"${process.execPath}"`, `"${nodeDir}"`, [`"${script}"`, ...args], { - stdio: ['pipe', 'pipe', process.stderr, 'ipc'], + stdio: ['pipe', 'pipe', process.stderr], shell: true, windowsHide: true, // signal,