issue-656/config-values-arent-scoped (#669)

* issue-656/scoped plugins to hyperterm.plugins

* Scoping plugin versions to hyperterm
This commit is contained in:
Brian Douglas 2016-08-29 15:38:05 +01:00 committed by Leo Lamprecht
parent f9d89176db
commit 9a0316dd59

View file

@ -79,7 +79,7 @@ function updatePlugins ({ force = false } = {}) {
} }
} else { } else {
// flag successful plugin update // flag successful plugin update
cache.set('plugins', id_); cache.set('hyperterm.plugins', id_);
// cache paths // cache paths
paths = getPaths(plugins); paths = getPaths(plugins);
@ -93,8 +93,8 @@ function updatePlugins ({ force = false } = {}) {
const loaded = modules.length; const loaded = modules.length;
const total = paths.plugins.length + paths.localPlugins.length; const total = paths.plugins.length + paths.localPlugins.length;
const pluginVersions = JSON.stringify(getPluginVersions()); const pluginVersions = JSON.stringify(getPluginVersions());
const changed = cache.get('plugin-versions') !== pluginVersions && loaded === total; const changed = cache.get('hyperterm.plugin-versions') !== pluginVersions && loaded === total;
cache.set('plugin-versions', pluginVersions); cache.set('hyperterm.plugin-versions', pluginVersions);
// notify watchers // notify watchers
if (force || changed) { if (force || changed) {
@ -148,7 +148,7 @@ exports.updatePlugins = updatePlugins;
// we schedule the initial plugins update // we schedule the initial plugins update
// a bit after the user launches the terminal // a bit after the user launches the terminal
// to prevent slowness // to prevent slowness
if (cache.get('plugins') !== id || process.env.HYPERTERM_FORCE_UPDATE) { if (cache.get('hyperterm.plugins') !== id || process.env.HYPERTERM_FORCE_UPDATE) {
// install immediately if the user changed plugins // install immediately if the user changed plugins
console.log('plugins have changed / not init, scheduling plugins installation'); console.log('plugins have changed / not init, scheduling plugins installation');
setTimeout(() => { setTimeout(() => {