From 154ca8575ca450405307958004e5c862a7cdda10 Mon Sep 17 00:00:00 2001 From: Patrick Detlefsen Date: Mon, 22 Jun 2015 15:33:08 +0200 Subject: [PATCH] limit the auto-updater-win api to very few methods --- .../api/lib/auto-updater/auto-updater-win.coffee | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/atom/browser/api/lib/auto-updater/auto-updater-win.coffee b/atom/browser/api/lib/auto-updater/auto-updater-win.coffee index a3fbd8822a..2da37ddb03 100644 --- a/atom/browser/api/lib/auto-updater/auto-updater-win.coffee +++ b/atom/browser/api/lib/auto-updater/auto-updater-win.coffee @@ -18,11 +18,11 @@ class AutoUpdater extends EventEmitter @emit 'checking-for-update' - unless SquirrelUpdate.existsSync() + unless SquirrelUpdate.supported() @emit 'update-not-available' return - @downloadUpdate (error, update) => + SquirrelUpdate.download (error, update) => if error? @emit 'update-not-available' return @@ -33,7 +33,7 @@ class AutoUpdater extends EventEmitter @emit 'update-available' - @installUpdate (error) => + SquirrelUpdate.update @updateUrl, (error) => if error? @emit 'update-not-available' return @@ -41,13 +41,4 @@ class AutoUpdater extends EventEmitter # info about the newly installed version and a function any of the event listeners can call to restart the application @emit 'update-downloaded', {}, update.releaseNotes, update.version, new Date(), @updateUrl, => @quitAndInstall() - downloadUpdate: (callback) -> - SquirrelUpdate.download(callback) - - installUpdate: (callback) -> - SquirrelUpdate.update(@updateUrl, callback) - - supportsUpdates: -> - SquirrelUpdate.supported() - module.exports = new AutoUpdater()