addresses suggestions from pull-request

This commit is contained in:
Patrick Detlefsen 2015-06-16 11:04:37 +02:00
parent 621178f558
commit 99f352228c
3 changed files with 10 additions and 6 deletions

View file

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

View file

@ -7,7 +7,10 @@ class AutoUpdater
quitAndInstall: -> quitAndInstall: ->
# TODO # TODO
setFeedUrl: (@updateUrl) -> setFeedUrl: (updateUrl) ->
# set feed URL only when it hasn't been set before
unless @updateUrl
@updateUrl = updateUrl
checkForUpdates: -> checkForUpdates: ->
throw new Error('Update URL is not set') unless @updateUrl throw new Error('Update URL is not set') unless @updateUrl

View file

@ -2,8 +2,8 @@ ChildProcess = require 'child_process'
fs = require 'fs' fs = require 'fs'
path = require 'path' path = require 'path'
appFolder = path.resolve(process.execPath, '..') # i.e. my-app/app-0.1.13/ appFolder = path.dirname(process.execPath) # i.e. my-app/app-0.1.13/
rootApplicationFolder = path.resolve(appFolder, '..') # i.e. my-app/ rootApplicationFolder = path.resolve(appFolder, '..') # i.e. my-app/
updateDotExe = path.join(rootApplicationFolder, 'Update.exe') updateDotExe = path.join(rootApplicationFolder, 'Update.exe')
exeName = path.basename(process.execPath) exeName = path.basename(process.execPath)