Added config switch for update channel (#2101)

This commit is contained in:
Leo Lamprecht 2017-08-20 12:18:42 +02:00 committed by GitHub
parent c16a145253
commit a0713f86e8
2 changed files with 12 additions and 2 deletions

View file

@ -1,11 +1,13 @@
// Packages
const {autoUpdater} = require('electron');
const ms = require('ms');
// Utilities
const notify = require('./notify'); // eslint-disable-line no-unused-vars
const {version} = require('./package');
const {getConfig} = require('./config');
const {platform} = process;
const FEED_URL = `https://releases.hyper.is/update/${platform}`;
let isInit = false;
@ -14,7 +16,11 @@ function init() {
console.error('Error fetching updates', msg + ' (' + err.stack + ')');
});
autoUpdater.setFeedURL(`${FEED_URL}/${version}`);
const config = getConfig();
const updatePrefix = config.canaryUpdates ? 'releases-canary' : 'releases';
const feedURL = `https://${updatePrefix}.hyper.is/update/${platform}`;
autoUpdater.setFeedURL(`${feedURL}/${version}`);
setTimeout(() => {
autoUpdater.checkForUpdates();

View file

@ -4,6 +4,10 @@
module.exports = {
config: {
// Choose either `false` for receiving highly polished,
// or `true` for less polished but more frequent updates
canaryUpdates: false,
// default font size in pixels for all tabs
fontSize: 12,