Replace "Url" in API names with "URL"

This commit is contained in:
Cheng Zhao 2015-11-13 16:03:40 +08:00
parent 8f56387bd9
commit fbb8e61958
57 changed files with 251 additions and 212 deletions

View file

@ -9,28 +9,28 @@ class AutoUpdater extends EventEmitter
squirrelUpdate.processStart()
app.quit()
setFeedUrl: (updateUrl) ->
@updateUrl = updateUrl
setFeedURL: (updateURL) ->
@updateURL = updateURL
checkForUpdates: ->
return @emitError 'Update URL is not set' unless @updateUrl
return @emitError 'Update URL is not set' unless @updateURL
return @emitError 'Can not find Squirrel' unless squirrelUpdate.supported()
@emit 'checking-for-update'
squirrelUpdate.download @updateUrl, (error, update) =>
squirrelUpdate.download @updateURL, (error, update) =>
return @emitError error if error?
return @emit 'update-not-available' unless update?
@emit 'update-available'
squirrelUpdate.update @updateUrl, (error) =>
squirrelUpdate.update @updateURL, (error) =>
return @emitError error if error?
{releaseNotes, version} = update
# Following information is not available on Windows, so fake them.
date = new Date
url = @updateUrl
url = @updateURL
@emit 'update-downloaded', {}, releaseNotes, version, date, url, => @quitAndInstall()