mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 04:25:55 +01:00
closes #2829
This commit is contained in:
@@ -22,15 +22,7 @@ module.exports = function(Plugins) {
|
||||
return callback();
|
||||
}
|
||||
|
||||
if (pluginData.compatibility && semver.validRange(pluginData.compatibility)) {
|
||||
if (!semver.gtr(pkg.version, pluginData.compatibility)) {
|
||||
// NodeBB may not be new enough to run this plugin
|
||||
process.stdout.write('\n');
|
||||
winston.warn('[plugins/' + pluginData.id + '] This plugin may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing.');
|
||||
winston.warn('[plugins/' + pluginData.id + '] In the event of an unresponsive NodeBB caused by this plugin, run ./nodebb reset plugin="' + pluginData.id + '".');
|
||||
process.stdout.write('\n');
|
||||
}
|
||||
}
|
||||
versionWarning(pluginData);
|
||||
|
||||
async.parallel([
|
||||
function(next) {
|
||||
@@ -63,6 +55,23 @@ module.exports = function(Plugins) {
|
||||
});
|
||||
};
|
||||
|
||||
function versionWarning(pluginData) {
|
||||
function display() {
|
||||
process.stdout.write('\n');
|
||||
winston.warn('[plugins/' + pluginData.id + '] This plugin may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing.');
|
||||
winston.warn('[plugins/' + pluginData.id + '] In the event of an unresponsive NodeBB caused by this plugin, run ./nodebb reset plugin="' + pluginData.id + '".');
|
||||
process.stdout.write('\n');
|
||||
}
|
||||
|
||||
if (pluginData.nbbpm && pluginData.nbbpm.compatibility && semver.validRange(pluginData.nbbpm.compatibility)) {
|
||||
if (!semver.gtr(pkg.version, pluginData.nbbpm.compatibility)) {
|
||||
display();
|
||||
}
|
||||
} else {
|
||||
display();
|
||||
}
|
||||
}
|
||||
|
||||
function registerHooks(pluginData, pluginPath, callback) {
|
||||
function libraryNotFound() {
|
||||
winston.warn('[plugins.reload] Library not found for plugin: ' + pluginData.id);
|
||||
|
||||
Reference in New Issue
Block a user