PR feedback adressed

This commit is contained in:
Patrick Detlefsen 2015-10-20 19:25:03 +02:00
parent 6c4016af46
commit db3bc28937
4 changed files with 10 additions and 15 deletions

View file

@ -1,6 +1,6 @@
switch process.platform
when 'win32'
autoUpdater = require('./auto-updater/auto-updater-win')
autoUpdater = require './auto-updater/auto-updater-win'
else
# take the default binding for the current platform
autoUpdater = process.atomBinding('auto_updater').autoUpdater

View file

@ -1,7 +1,7 @@
{EventEmitter} = require 'events'
SquirrelUpdate = require './auto-updater/squirrel-update-win'
app = require('app')
url = require('url')
app = require 'app'
url = require 'url'
class AutoUpdater extends EventEmitter
@ -12,14 +12,7 @@ class AutoUpdater extends EventEmitter
setFeedUrl: (updateUrl) ->
# set feed URL only when it hasn't been set before
unless @updateUrl
# See https://github.com/Squirrel/Squirrel.Windows/issues/132
# This way the Mac and Windows Update URL can be the same, even when
# the Mac version is sending additional data in the query string.
parsedUrl = url.parse(updateUrl)
delete parsedUrl.search
delete parsedUrl.query
@updateUrl = url.format(parsedUrl)
@updateUrl = updateUrl
checkForUpdates: ->
throw new Error('Update URL is not set') unless @updateUrl

View file

@ -2,10 +2,10 @@ ChildProcess = require 'child_process'
fs = require 'fs'
path = require 'path'
appFolder = path.dirname(process.execPath) # i.e. my-app/app-0.1.13/
rootApplicationFolder = path.resolve(appFolder, '..') # i.e. my-app/
updateDotExe = path.join(rootApplicationFolder, 'Update.exe')
exeName = path.basename(process.execPath)
appFolder = path.dirname process.execPath # i.e. my-app/app-0.1.13/
rootApplicationFolder = path.resolve appFolder, '..' # i.e. my-app/
updateDotExe = path.join rootApplicationFolder, 'Update.exe'
exeName = path.basename process.execPath
# Spawn a command and invoke the callback when it completes with an error
# and the output from standard out.

View file

@ -11,6 +11,8 @@
'atom/browser/api/lib/app.coffee',
'atom/browser/api/lib/atom-delegate.coffee',
'atom/browser/api/lib/auto-updater.coffee',
'atom/browser/api/lib/auto-updater/auto-updater-win.coffee',
'atom/browser/api/lib/auto-updater/squirrel-update-win.coffee',
'atom/browser/api/lib/browser-window.coffee',
'atom/browser/api/lib/content-tracing.coffee',
'atom/browser/api/lib/dialog.coffee',