]> khamidou — GitHub mirrors - electron.git/commitdiff
limit the auto-updater-win api to very few methods
authorPatrick Detlefsen <patrick.detlefsen@gmail.com>
Mon, 22 Jun 2015 13:33:08 +0000 (15:33 +0200)
committerPatrick Detlefsen <patrick.detlefsen@gmail.com>
Mon, 22 Jun 2015 13:33:08 +0000 (15:33 +0200)
atom/browser/api/lib/auto-updater/auto-updater-win.coffee

index a3fbd8822ada51f975bebf266bc549c83097b2d2..2da37ddb035e0252e3cae7039ddb852595aa14be 100644 (file)
@@ -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()