Simpilfy auto_updater api.

This commit is contained in:
Cheng Zhao 2014-04-17 17:26:21 +08:00
parent f36569c3b9
commit 8f2b998718
3 changed files with 45 additions and 62 deletions

View file

@ -1,9 +1,8 @@
AutoUpdater = process.atomBinding('auto_updater').AutoUpdater
autoUpdater = process.atomBinding('auto_updater').autoUpdater
EventEmitter = require('events').EventEmitter
AutoUpdater::__proto__ = EventEmitter.prototype
autoUpdater.__proto__ = EventEmitter.prototype
autoUpdater = new AutoUpdater
autoUpdater.on 'update-downloaded-raw', (args...) ->
args[3] = new Date(args[3]) # releaseDate
@emit 'update-downloaded', args..., => @quitAndInstall()