mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-13 04:28:41 -09:00
Added config switch for update channel (#2101)
This commit is contained in:
parent
c16a145253
commit
a0713f86e8
2 changed files with 12 additions and 2 deletions
|
|
@ -1,11 +1,13 @@
|
||||||
|
// Packages
|
||||||
const {autoUpdater} = require('electron');
|
const {autoUpdater} = require('electron');
|
||||||
const ms = require('ms');
|
const ms = require('ms');
|
||||||
|
|
||||||
|
// Utilities
|
||||||
const notify = require('./notify'); // eslint-disable-line no-unused-vars
|
const notify = require('./notify'); // eslint-disable-line no-unused-vars
|
||||||
const {version} = require('./package');
|
const {version} = require('./package');
|
||||||
|
const {getConfig} = require('./config');
|
||||||
|
|
||||||
const {platform} = process;
|
const {platform} = process;
|
||||||
const FEED_URL = `https://releases.hyper.is/update/${platform}`;
|
|
||||||
|
|
||||||
let isInit = false;
|
let isInit = false;
|
||||||
|
|
||||||
|
|
@ -14,7 +16,11 @@ function init() {
|
||||||
console.error('Error fetching updates', msg + ' (' + err.stack + ')');
|
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(() => {
|
setTimeout(() => {
|
||||||
autoUpdater.checkForUpdates();
|
autoUpdater.checkForUpdates();
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,10 @@
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
config: {
|
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
|
// default font size in pixels for all tabs
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue