Skip to content

Commit

Permalink
#2 Initial support for auto updater, next needs code signing
Browse files Browse the repository at this point in the history
  • Loading branch information
rdsubhas committed Oct 24, 2015
1 parent 377ea0c commit 289d541
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
29 changes: 29 additions & 0 deletions lib/updater.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
'use strict'

const autoUpdater = require('auto-updater')
const pkg = require('../package.json')
const autoUpdateUrl = `http://docker-menu-updater.herokuapp.com/v1/rdsubhas/docker-menu/${pkg.version}`

autoUpdater.on('error', function () {
console.log('error', arguments)
})

autoUpdater.on('checking-for-update', function () {
console.log('checking-for-update', arguments)
})

autoUpdater.on('update-available', function () {
console.log('update-available', arguments)
})

autoUpdater.on('update-not-available', function () {
console.log('update-not-available', arguments)
})

autoUpdater.on('update-downloaded', function () {
console.log('update-downloaded', arguments)
})

autoUpdater.setFeedUrl(autoUpdateUrl)

module.exports = autoUpdater
6 changes: 6 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const ipc = require('ipc')
const fixPath = require('fix-path')
const Tray = require('tray')
const Menu = require('./lib/menu')
const Updater = require('./lib/updater')

// report crashes to the Electron project
require('crash-reporter').start()
Expand All @@ -24,4 +25,9 @@ app.on('ready', function () {
ipc.on('app-quit', function () {
app.quit()
})

// Check for updates
if (process.env.NODE_ENV !== 'development') {
Updater.checkForUpdates()
}
})

1 comment on commit 289d541

@rdsubhas
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually related to #4

Please sign in to comment.