parent
3c976a9483
commit
854afc27cf
|
@ -206,7 +206,7 @@
|
||||||
"metaError": "META could not be parsed.",
|
"metaError": "META could not be parsed.",
|
||||||
"missingNameData": "META missing name data.",
|
"missingNameData": "META missing name data.",
|
||||||
"metaNotFound": "META was not found.",
|
"metaNotFound": "META was not found.",
|
||||||
"compileError": "Could not be compiled.",
|
"compileError": "Could not be compiled. See console for details.",
|
||||||
"wasUnloaded": "{{name}} was unloaded.",
|
"wasUnloaded": "{{name}} was unloaded.",
|
||||||
"blankSlateHeader": "You don't have any {{type}}s!",
|
"blankSlateHeader": "You don't have any {{type}}s!",
|
||||||
"blankSlateMessage": "Grab some from [this website]({{link}}) and add them to your {{type}} folder."
|
"blankSlateMessage": "Grab some from [this website]({{link}}) and add them to your {{type}} folder."
|
||||||
|
|
|
@ -209,7 +209,7 @@ export default class AddonManager {
|
||||||
__non_webpack_require__(path.resolve(this.addonFolder, filename));
|
__non_webpack_require__(path.resolve(this.addonFolder, filename));
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
Logger.err(this.name, `Could not load ${path.basename(filename)}:`, error);
|
Logger.stacktrace(this.name, `Could not load ${path.basename(filename)}:`, error);
|
||||||
return new AddonError(filename, filename, Strings.Addons.compileError, {message: error.message, stack: error.stack}, this.prefix);
|
return new AddonError(filename, filename, Strings.Addons.compileError, {message: error.message, stack: error.stack}, this.prefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,12 +75,13 @@ export default new class PluginManager extends AddonManager {
|
||||||
|
|
||||||
/* Overrides */
|
/* Overrides */
|
||||||
initializeAddon(addon) {
|
initializeAddon(addon) {
|
||||||
if (!addon.exports) return new AddonError(addon.name, addon.filename, "Plugin had no exports", {message: "Plugin had no exports or no name property.", stack: ""}, this.prefix);
|
if (!addon.exports || !addon.name) return new AddonError(addon.name || addon.filename, addon.filename, "Plugin had no exports or @name property", {message: "Plugin had no exports or no @name property. @name property is required for all addons.", stack: ""}, this.prefix);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const PluginClass = addon.exports;
|
const PluginClass = addon.exports;
|
||||||
const thePlugin = new PluginClass();
|
const thePlugin = new PluginClass();
|
||||||
addon.instance = thePlugin;
|
addon.instance = thePlugin;
|
||||||
addon.name = thePlugin.getName ? thePlugin.getName() : addon.name || "No name";
|
addon.name = thePlugin.getName ? thePlugin.getName() : addon.name;
|
||||||
addon.author = thePlugin.getAuthor ? thePlugin.getAuthor() : addon.author || "No author";
|
addon.author = thePlugin.getAuthor ? thePlugin.getAuthor() : addon.author || "No author";
|
||||||
addon.description = thePlugin.getDescription ? thePlugin.getDescription() : addon.description || "No description";
|
addon.description = thePlugin.getDescription ? thePlugin.getDescription() : addon.description || "No description";
|
||||||
addon.version = thePlugin.getVersion ? thePlugin.getVersion() : addon.version || "No version";
|
addon.version = thePlugin.getVersion ? thePlugin.getVersion() : addon.version || "No version";
|
||||||
|
|
Loading…
Reference in New Issue