Add autoUpdatePlugins option

This commit is contained in:
hector 2019-05-09 12:28:52 +08:00 committed by Benjamin Staneck
parent bc8f883a6d
commit 9ba47135a8

View file

@ -183,8 +183,13 @@ if (cache.get('hyper.plugins') !== id || process.env.HYPER_FORCE_UPDATE) {
}, 1000);
}
// otherwise update plugins every 5 hours
setInterval(updatePlugins, ms('5h'));
(() => {
const baseConfig = config.getConfig();
if (baseConfig['autoUpdatePlugins']) {
// otherwise update plugins every 5 hours
setInterval(updatePlugins, ms(baseConfig['autoUpdatePlugins'] === true ? '5h' : baseConfig['autoUpdatePlugins']));
}
})();
function syncPackageJSON() {
const dependencies = toDependencies(plugins);