From 8cffc3b5b42baacfbd4c54da9433de3d994b7895 Mon Sep 17 00:00:00 2001 From: "Kyle J. Kemp" Date: Tue, 15 Oct 2024 09:24:34 -0500 Subject: [PATCH] expose devtools if --dev is passed to the client --- src/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 5b90019..94e91dd 100644 --- a/src/index.js +++ b/src/index.js @@ -7,6 +7,10 @@ const { autoUpdater } = require("electron-updater"); const Config = require("electron-config"); const config = new Config(); +console.log(process.argv); + +const showDevTools = process.argv.includes("--dev"); + // Handle creating/removing shortcuts on Windows when installing/uninstalling. if (require("electron-squirrel-startup")) { // eslint-disable-line global-require @@ -50,7 +54,9 @@ const createWindow = () => { mainWindow.loadFile(path.join(__dirname, "index.html")); // Open the DevTools. - // mainWindow.webContents.openDevTools(); + if (showDevTools) { + mainWindow.webContents.openDevTools(); + } }; // This method will be called when Electron has finished