Make atom.update() work.

This commit is contained in:
Cheng Zhao
2013-06-03 22:48:52 +08:00
parent d224f3c5bd
commit 495b218c7f
2 changed files with 6 additions and 1 deletions

View File

@@ -244,7 +244,7 @@ window.atom =
windowState
update: ->
throw new Error('atom.update is not implemented')
ipc.sendChannel 'install-update'
getUpdateStatus: (callback) ->
throw new Error('atom.getUpdateStatus is not implemented')

View File

@@ -35,6 +35,7 @@ class AtomApplication
configWindow: null
menu: null
resourcePath: null
installUpdate: null
version: null
constructor: ({@resourcePath, pathsToOpen, @version, test, pidToKillWhenClosed, @dev}) ->
@@ -187,6 +188,7 @@ class AtomApplication
autoUpdater.on 'ready-for-update-on-quit', (event, version, quitAndUpdate) =>
event.preventDefault()
@installUpdate = quitAndUpdate
@buildApplicationMenu version, quitAndUpdate
ipc.on 'close-without-confirm', (processId, routingId) ->
@@ -206,6 +208,9 @@ class AtomApplication
ipc.on 'new-window', =>
@open()
ipc.on 'install-update', =>
@installUpdate?()
ipc.on 'get-version', (event) =>
event.result = @version