From 2297669e6d7da8c9981f051e7ccda3291c08793b Mon Sep 17 00:00:00 2001 From: theolivenbaum Date: Wed, 27 Oct 2021 09:11:33 +0200 Subject: [PATCH] Update main.js --- ElectronNET.Host/main.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ElectronNET.Host/main.js b/ElectronNET.Host/main.js index 3acfa85..c2b73e6 100644 --- a/ElectronNET.Host/main.js +++ b/ElectronNET.Host/main.js @@ -1,4 +1,4 @@ -const { app } = require('electron'); +const { app } = require('electron'); const { BrowserWindow } = require('electron'); const { protocol } = require('electron'); const path = require('path'); @@ -6,8 +6,9 @@ const cProcess = require('child_process'); const process = require('process'); const portscanner = require('portscanner'); const { imageSize } = require('image-size'); +const { connect } = require('http2'); -fixPath(); +fixPath(); //For macOS and Linux packaged-apps, the path variable might be missing let io, server, browserWindows, ipc, apiProcess, loadURL; let appApi, menu, dialogApi, notification, tray, webContents; @@ -507,7 +508,10 @@ function shellEnvSync() { } try { - const { stdout } = cProcess.spawnSync(shell, args, { env }) + let { stdout } = cProcess.spawnSync(shell, args, { env }); + if(Buffer.isBuffer(stdout)){ + stdout = stdout.toString(); + } return parseEnv(stdout); } catch (error) { if (shell) {