Skip to content

Commit

Permalink
Add SHOW_DEV_TOOLS environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe HAMERLING authored and saghul committed Jun 9, 2020
1 parent 69aea45 commit 212d8cb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ npm start

The debugger tools are available when running in dev mode and can be activated with keyboard shortcuts as defined here https://github.com/sindresorhus/electron-debug#features.

It can also be displayed automatically from the `SHOW_DEV_TOOLS` environment variable such as:

```bash
SHOW_DEV_TOOLS=true npm start
```

#### Building the production distribution

```bash
Expand Down
4 changes: 3 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const path = require('path');
const URL = require('url');
const config = require('./app/features/config');

const showDevTools = Boolean(process.env.SHOW_DEV_TOOLS);

// We need this because of https://github.com/electron/electron/issues/18214
app.commandLine.appendSwitch('disable-site-isolation-trials');

Expand Down Expand Up @@ -51,7 +53,7 @@ contextMenu({
// show them automatically though.
debug({
isEnabled: true,
showDevTools: false
showDevTools
});

/**
Expand Down

0 comments on commit 212d8cb

Please sign in to comment.