Move implementation of auto-updater on OS X to another file
This commit is contained in:
parent
85c84a0eb0
commit
d74ef5c078
3 changed files with 28 additions and 25 deletions
20
atom/browser/api/lib/auto-updater/auto-updater-mac.coffee
Normal file
20
atom/browser/api/lib/auto-updater/auto-updater-mac.coffee
Normal file
|
@ -0,0 +1,20 @@
|
|||
{EventEmitter} = require 'events'
|
||||
{autoUpdater} = process.atomBinding 'auto_updater'
|
||||
|
||||
autoUpdater.__proto__ = EventEmitter.prototype
|
||||
|
||||
autoUpdater.quitAndInstall = ->
|
||||
# If we don't have any window then quitAndInstall immediately.
|
||||
BrowserWindow = require 'browser-window'
|
||||
windows = BrowserWindow.getAllWindows()
|
||||
if windows.length is 0
|
||||
@_quitAndInstall()
|
||||
return
|
||||
|
||||
# Do the restart after all windows have been closed.
|
||||
app = require 'app'
|
||||
app.removeAllListeners 'window-all-closed'
|
||||
app.once 'window-all-closed', @_quitAndInstall.bind(this)
|
||||
win.close() for win in windows
|
||||
|
||||
module.exports = autoUpdater
|
Loading…
Add table
Add a link
Reference in a new issue