mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Add unsupported state to update manager
This commit is contained in:
@@ -7,6 +7,7 @@ CheckingState = 'checking'
|
||||
DownladingState = 'downloading'
|
||||
UpdateAvailableState = 'update-available'
|
||||
NoUpdateAvailableState = 'no-update-available'
|
||||
UnsupportedState = 'unsupported'
|
||||
ErrorState = 'error'
|
||||
|
||||
module.exports =
|
||||
@@ -53,6 +54,12 @@ class AutoUpdateManager
|
||||
unless /\w{7}/.test(@version)
|
||||
@check(hidePopups: true)
|
||||
|
||||
switch process.platform
|
||||
when 'win32'
|
||||
@setState(UnsupportedState) unless autoUpdater.supportsUpdates()
|
||||
when 'linux'
|
||||
@setState(UnsupportedState)
|
||||
|
||||
emitUpdateAvailableEvent: (windows...) ->
|
||||
return unless @releaseVersion? and @releaseNotes
|
||||
for atomWindow in windows
|
||||
|
||||
@@ -36,6 +36,9 @@ class AutoUpdater
|
||||
installUpdate: (callback) ->
|
||||
SquirrelUpdate.spawn(['--update', @updateUrl], callback)
|
||||
|
||||
supportsUpdates: ->
|
||||
SquirrelUpdate.existsSync()
|
||||
|
||||
checkForUpdates: ->
|
||||
throw new Error('Update URL is not set') unless @updateUrl
|
||||
|
||||
|
||||
Reference in New Issue
Block a user