mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 23:15:48 +01:00
closes #2829
This commit is contained in:
@@ -22,15 +22,7 @@ module.exports = function(Plugins) {
|
|||||||
return callback();
|
return callback();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pluginData.compatibility && semver.validRange(pluginData.compatibility)) {
|
versionWarning(pluginData);
|
||||||
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');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async.parallel([
|
async.parallel([
|
||||||
function(next) {
|
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 registerHooks(pluginData, pluginPath, callback) {
|
||||||
function libraryNotFound() {
|
function libraryNotFound() {
|
||||||
winston.warn('[plugins.reload] Library not found for plugin: ' + pluginData.id);
|
winston.warn('[plugins.reload] Library not found for plugin: ' + pluginData.id);
|
||||||
|
|||||||
Reference in New Issue
Block a user