From 9ba47135a84df9d4535312ac27edf337589aeec7 Mon Sep 17 00:00:00 2001 From: hector Date: Thu, 9 May 2019 12:28:52 +0800 Subject: [PATCH] Add autoUpdatePlugins option --- app/plugins.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/plugins.js b/app/plugins.js index b0b53263..cb2bcc72 100644 --- a/app/plugins.js +++ b/app/plugins.js @@ -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);