From 4e46b16c1352e455cbf98dfa7204f5fc4a1cb75f Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 19 May 2016 20:03:37 -0700 Subject: [PATCH] auto updater: code style --- config.js | 3 +-- main/updater.js | 8 ++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/config.js b/config.js index 95da64fc..ace04e58 100644 --- a/config.js +++ b/config.js @@ -19,8 +19,7 @@ module.exports = { APP_VERSION: APP_VERSION, APP_WINDOW_TITLE: APP_NAME + ' (BETA)', - AUTO_UPDATE_URL: 'https://webtorrent.io/desktop/update' + - '?version=' + APP_VERSION + '&platform=' + process.platform, + AUTO_UPDATE_URL: 'https://webtorrent.io/desktop/update', CRASH_REPORT_URL: 'https://webtorrent.io/desktop/crash-report', diff --git a/main/updater.js b/main/updater.js index 5cdc54f9..71f8922b 100644 --- a/main/updater.js +++ b/main/updater.js @@ -9,6 +9,10 @@ var config = require('../config') var log = require('./log') var windows = require('./windows') +var AUTO_UPDATE_URL = config.AUTO_UPDATE_URL + + '?version=' + config.APP_VERSION + + '&platform=' + process.platform + function init () { if (process.platform === 'linux') { initLinux() @@ -20,7 +24,7 @@ function init () { // The Electron auto-updater does not support Linux yet, so manually check for updates and // `show the user a modal notification. function initLinux () { - get.concat(config.AUTO_UPDATE_URL, onResponse) + get.concat(AUTO_UPDATE_URL, onResponse) function onResponse (err, res, data) { if (err) return log(`Update error: ${err.message}`) @@ -67,6 +71,6 @@ function initDarwinWin32 () { (e, notes, name, date, url) => log(`Update downloaded: ${name}: ${url}`) ) - electron.autoUpdater.setFeedURL(config.AUTO_UPDATE_URL) + electron.autoUpdater.setFeedURL(AUTO_UPDATE_URL) electron.autoUpdater.checkForUpdates() }