Skip to content

Commit

Permalink
expose devtools if --dev is passed to the client
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Oct 15, 2024
1 parent a62c7d7 commit 8cffc3b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8cffc3b

Please sign in to comment.