Skip to content

Commit

Permalink
fix: path win32
Browse files Browse the repository at this point in the history
  • Loading branch information
hrenaud committed Sep 30, 2024
1 parent 3b2b0ca commit 1c98694
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/handlers/HandleCollectAll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 1c98694

Please sign in to comment.