Skip to content

Commit

Permalink
Merge pull request #86 from electron/dont-reinstall-devtron
Browse files Browse the repository at this point in the history
Don't install Devtron if it is already installed
  • Loading branch information
kevinsawicki authored Sep 15, 2016
2 parents 20429d2 + ecad809 commit 27052d5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ const electron = require('electron')
exports.install = () => {
if (process.type === 'renderer') {
console.log(`Installing Devtron from ${__dirname}`)
if (electron.remote.BrowserWindow.getDevToolsExtensions &&
electron.remote.BrowserWindow.getDevToolsExtensions().devtron) return true
return electron.remote.BrowserWindow.addDevToolsExtension(__dirname)
} else if (process.type === 'browser') {
console.log(`Installing Devtron from ${__dirname}`)
if (electron.BrowserWindow.getDevToolsExtensions &&
electron.BrowserWindow.getDevToolsExtensions().devtron) return true
return electron.BrowserWindow.addDevToolsExtension(__dirname)
} else {
throw new Error('Devtron can only be installed from an Electron process.')
Expand Down

0 comments on commit 27052d5

Please sign in to comment.