v1.18.x
barisusakli 10 years ago
parent 289474edf7
commit 3dd337bd34

@ -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);

Loading…
Cancel
Save