updater(*): Send current platform in update check, publish to S3 in /darwin/ folder

This commit is contained in:
Ben Gotow 2015-06-30 11:03:24 -07:00
parent 4267de5f1e
commit d8ec1417ec
3 changed files with 6 additions and 6 deletions

View file

@ -77,7 +77,7 @@ module.exports = (grunt) ->
return version
uploadDMGToS3 = (s3Client) ->
destName = "Edgehill_#{getVersion()}.dmg"
destName = "#{process.platform}/Edgehill_#{getVersion()}.dmg"
dmgPath = path.join(grunt.config.get('atom.buildDir'), dmgName())
new Promise (resolve, reject) ->
uploadFile(s3Client, dmgPath, destName)
@ -90,7 +90,7 @@ module.exports = (grunt) ->
.catch(reject)
uploadZipToS3 = (s3Client) ->
destName = "Edgehill_#{getVersion()}.zip"
destName = "#{process.platform}/Edgehill_#{getVersion()}.zip"
buildDir = grunt.config.get('atom.buildDir')
grunt.log.writeln ">> Creating zip file…"

View file

@ -8,7 +8,7 @@ describe "AutoUpdateManager", ->
c5 = get: -> "commit"
c6 = get: -> "foo"
base = "https://edgehill.nylas.com/update-check?version="
base = "https://edgehill.nylas.com/update-check?platform=#{process.platform}&version="
beforeEach ->
@feedUrl = (version, config) ->

View file

@ -18,13 +18,13 @@ class AutoUpdateManager
constructor: (@version, @config, @specMode) ->
@state = IdleState
if process.platform is 'win32'
# Squirrel for Windows can't handle query params
# https://github.com/Squirrel/Squirrel.Windows/issues/132
@feedUrl = 'https://edgehill.nylas.com/update-check'
@feedUrl = "https://edgehill.nylas.com/update-check/win32/#{@getUpgradeLevel()}/#{@version}"
else
upgradeLevel = @getUpgradeLevel()
@feedUrl = "https://edgehill.nylas.com/update-check?version=#{@version}&level=#{upgradeLevel}"
@feedUrl = "https://edgehill.nylas.com/update-check?platform=#{process.platform}&version=#{@version}&level=#{@getUpgradeLevel()}"
if not @specMode
process.nextTick => @setupAutoUpdater()