Support scoped theme packages

This commit is contained in:
Peter Jaszkowiak
2018-06-09 16:26:28 -06:00
committed by Julian Lam
parent d656c65c9a
commit 70ff2d9b88
10 changed files with 98 additions and 29 deletions

View File

@@ -122,13 +122,16 @@ module.exports = function (Plugins) {
], callback);
};
var themeNamePattern = /(@.*?\/)?nodebb-theme-.*$/;
Plugins.loadPlugin = function (pluginPath, callback) {
Plugins.data.loadPluginInfo(pluginPath, function (err, pluginData) {
if (err) {
if (err.message === '[[error:parse-error]]') {
return callback();
}
return callback(pluginPath.match('nodebb-theme') ? null : err);
return callback(themeNamePattern.test(pluginPath) ? null : err);
}
checkVersion(pluginData);