File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ const electron = require('electron')
2
2
const app = electron . app
3
3
const Menu = electron . Menu
4
4
const ipc = electron . ipcMain
5
- const GhReleases = require ( 'electron-gh-releases' )
5
+ const GhReleases = require ( 'electron-gh-releases' )
6
+ const isDev = require ( 'electron-is-dev' ) //isDev is True if running in development mode. Overide by setting ELECTRON_IS_DEV environment variable to 1
6
7
// electron.crashReporter.start()
7
8
var ipcServer = null
8
9
@@ -35,6 +36,10 @@ const updater = new GhReleases(ghReleasesOpts)
35
36
// Check for updates
36
37
// `status` returns true if there is a new update available
37
38
function checkUpdate ( ) {
39
+ if ( isDev ) { //Prevents app from attempting to update when in dev mode.
40
+ console . log ( "Updates are disabled in Development mode, see main-app.js" )
41
+ return true
42
+ }
38
43
if ( process . platform === 'linux' || isUpdateReady ) {
39
44
return true
40
45
}
@@ -94,12 +99,12 @@ app.on('ready', function () {
94
99
95
100
// Check update every day
96
101
setInterval ( function ( ) {
97
- checkUpdate ( )
102
+ if ( ! isDev ) checkUpdate ( )
98
103
} , 1000 * 60 * 60 * 24 )
99
104
100
105
// Check update after 10 secs to prevent file locking of Windows
101
106
setTimeout ( ( ) => {
102
- checkUpdate ( )
107
+ if ( ! isDev ) checkUpdate ( )
103
108
104
109
ipc . on ( 'update-check' , function ( event , msg ) {
105
110
if ( isUpdateReady ) {
Original file line number Diff line number Diff line change 59
59
"codemirror-mode-elixir" : " ^1.1.1" ,
60
60
"electron-config" : " ^1.0.0" ,
61
61
"electron-gh-releases" : " ^2.0.4" ,
62
+ "electron-is-dev" : " ^1.0.1" ,
62
63
"escape-string-regexp" : " ^1.0.5" ,
63
64
"file-uri-to-path" : " ^1.0.0" ,
64
65
"file-url" : " ^2.0.2" ,
You can’t perform that action at this time.
0 commit comments