From 119fc7f4f278bfe270748b9fac31f5ec3129553d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 13 Nov 2014 09:36:17 -0800 Subject: [PATCH] DRY up Update.exe path computing --- src/browser/auto-updater-win32.coffee | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/browser/auto-updater-win32.coffee b/src/browser/auto-updater-win32.coffee index b5e8a00e8..d801dc598 100644 --- a/src/browser/auto-updater-win32.coffee +++ b/src/browser/auto-updater-win32.coffee @@ -14,7 +14,7 @@ class AutoUpdater @updateUrl = url quitAndInstall: -> - updateDotExe = path.join(path.dirname(process.execPath), '..', 'update.exe') + updateDotExe = @getUpdateExePath() unless fs.existsSync(updateDotExe) console.log 'Running developer or Chocolatey version of Atom, skipping' @@ -28,12 +28,15 @@ class AutoUpdater ChildProcess.execFile updateDotExe, args, -> shellAutoUpdater.quitAndInstall() + getUpdateExePath: -> + path.resolve(path.dirname(process.execPath), '..', 'Update.exe') + checkForUpdates: -> throw new Error('Update URL is not set') unless @updateUrl emit 'checking-for-update' - updateDotExe = path.join(path.dirname(process.execPath), '..', 'update.exe') + updateDotExe = @getUpdateExePath() unless fs.existsSync(updateDotExe) console.log 'Running developer or Chocolatey version of Atom, skipping'