From e382dcab135d587b15fbd7ec652e24de09d42bfd Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 20 Aug 2015 11:01:59 -0400 Subject: [PATCH] Reduce verbosity of plugin incompatibility errors Instead of showing a 4-5 line warning for each potentially incompatible plugin, we'll show the warning and then a list of plugins. --- src/plugins.js | 12 ++++++++++++ src/plugins/load.js | 17 ++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/plugins.js b/src/plugins.js index d2a726096b..046809e76e 100644 --- a/src/plugins.js +++ b/src/plugins.js @@ -31,6 +31,7 @@ var fs = require('fs'), Plugins.clientScripts = []; Plugins.customLanguages = []; Plugins.libraryPaths = []; + Plugins.versionWarning = []; Plugins.initialized = false; @@ -74,6 +75,7 @@ var fs = require('fs'), Plugins.libraries = {}; Plugins.loadedHooks = {}; Plugins.staticDirs = {}; + Plugins.versionWarning = []; Plugins.cssFiles.length = 0; Plugins.lessFiles.length = 0; Plugins.clientScripts.length = 0; @@ -106,6 +108,16 @@ var fs = require('fs'), }); }, function(next) { + // If some plugins are incompatible, throw the warning here + if (Plugins.versionWarning.length) { + process.stdout.write('\n'); + winston.warn('[plugins/load] The following plugins may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing. In the event of an unresponsive NodeBB caused by this plugin, run `./nodebb reset -p PLUGINNAME` to disable it.'); + for(var x=0,numPlugins=Plugins.versionWarning.length;x