avoid loading the same plugin twice
This commit is contained in:
@@ -106,7 +106,11 @@ const pluginController = {
|
|||||||
try {
|
try {
|
||||||
const plugin = require(pluginFile)
|
const plugin = require(pluginFile)
|
||||||
const name = plugin.configuration.name
|
const name = plugin.configuration.name
|
||||||
log.info(`Found plugin '${name}'`)
|
log.info(`Found plugin '${name}' in '${pluginFile}'`)
|
||||||
|
if (pluginController.plugins.find(p => p.configuration.name === name)) {
|
||||||
|
log.warn(`Cannot load plugins with the same name: plugin '${name}' already exists`)
|
||||||
|
return
|
||||||
|
}
|
||||||
pluginController.plugins.push(plugin)
|
pluginController.plugins.push(plugin)
|
||||||
if (settingsController.settings['plugin_' + name]) {
|
if (settingsController.settings['plugin_' + name]) {
|
||||||
const pluginSetting = settingsController.settings['plugin_' + name]
|
const pluginSetting = settingsController.settings['plugin_' + name]
|
||||||
|
|||||||
Reference in New Issue
Block a user