Skip to content

Commit

Permalink
fix(api): isDev should work properly when execName starts with electron
Browse files Browse the repository at this point in the history
  • Loading branch information
megahertz committed Jul 31, 2021
1 parent a711b95 commit 04fa40d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/electronApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Split Electron API from the main code
*/

var path = require('path');
var electron;
try {
// eslint-disable-next-line global-require
Expand Down Expand Up @@ -119,7 +120,8 @@ function isDev() {
}

if (typeof process.execPath === 'string') {
return process.execPath.toLowerCase().endsWith('electron');
var execFileName = path.basename(process.execPath).toLowerCase();
return execFileName.startsWith('electron');
}

return process.env.NODE_ENV === 'development'
Expand Down

0 comments on commit 04fa40d

Please sign in to comment.