From a1b5f4350919576068fe6e981bfe68a1b3612f7c Mon Sep 17 00:00:00 2001 From: Renaud Heluin Date: Sun, 1 Sep 2024 09:59:22 +0200 Subject: [PATCH] fix: fix path for win32 Nouvelle initialisation de l'application #47 --- .../src/main/handlers/initHandlers/plugin_canInstall.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/electron-app/ecoindex-app/src/main/handlers/initHandlers/plugin_canInstall.ts b/electron-app/ecoindex-app/src/main/handlers/initHandlers/plugin_canInstall.ts index e536a72..43faad1 100644 --- a/electron-app/ecoindex-app/src/main/handlers/initHandlers/plugin_canInstall.ts +++ b/electron-app/ecoindex-app/src/main/handlers/initHandlers/plugin_canInstall.ts @@ -36,11 +36,10 @@ export const initPluginCanInstall = ( } if (stderr) mainLog.debug(`stderr: ${stderr}`) if (stdout) { - const returned: string = path.join( - stdout.trim(), - `lib`, - `node_modules` - ) + const returned: string = + os.platform() === 'win32' + ? path.join(stdout.trim(), `node_modules`) + : path.join(stdout.trim(), `lib`, `node_modules`) // mainLog.debug(`Node path: ${returned}`) toReturned.result = true toReturned.message = `User can install plugins in ${returned}`