@@ -2,6 +2,8 @@ var app = require('app');
22var path = require ( 'path' ) ;
33var ipc = require ( 'ipc' ) ;
44
5+ var ghReleases = require ( 'electron-gh-releases' ) ;
6+
57require ( 'crash-reporter' ) . start ( ) ;
68
79var Menu = require ( 'menu' ) ;
@@ -12,6 +14,52 @@ var AutoLaunch = require('auto-launch');
1214var iconIdle = path . join ( __dirname , 'images' , 'tray-idleTemplate.png' ) ;
1315var iconActive = path . join ( __dirname , 'images' , 'tray-active.png' ) ;
1416
17+ var ghReleasesOptions = {
18+ repo : 'ekonstantinidis/testify' ,
19+ currentVersion : app . getVersion ( )
20+ } ;
21+
22+ var update = new ghReleases ( ghReleasesOptions , function ( autoUpdater ) {
23+ // Auto updater event listener
24+ console . log ( '.......' ) ;
25+ console . log ( '.......' ) ;
26+ console . log ( app . getVersion ( ) ) ;
27+ console . log ( '.......' ) ;
28+ console . log ( '.......' ) ;
29+ // autoUpdater.checkForUpdates();
30+
31+ autoUpdater
32+ // .on('checking-for-update', function() {
33+ // console.log('Checking for update');
34+ // })
35+ . on ( 'update-downloaded' , function ( e , rNotes , rName , rDate , uUrl , quitAndUpdate ) {
36+ // Install the update
37+ console . log ( 'Update Downloaded...' ) ;
38+ quitAndUpdate ( ) ;
39+ } ) ;
40+ } ) ;
41+
42+ // Check for updates
43+ update . check ( function ( err , status ) {
44+ console . log ( 'ERR: ' + err + '. STATUS: ' + status ) ;
45+
46+ if ( ! err && status ) {
47+ update . download ( ) ;
48+ }
49+ } ) ;
50+
51+ // autoUpdater
52+ //
53+ // .on('update-available', function() {
54+ // console.log('Update available');
55+ // })
56+ // .on('update-not-available', function() {
57+ // console.log('Update not available');
58+ // })
59+ // .on('update-downloaded', function() {
60+ // console.log('Update downloaded');
61+ // });
62+
1563var autoStart = new AutoLaunch ( {
1664 name : 'Gitify' ,
1765 path : process . execPath . match ( / .* ?\. a p p / ) [ 0 ]
0 commit comments