Allow env variable to point to specific plugin path for debugging

This commit is contained in:
advplyr 2024-12-23 16:53:47 -06:00
parent cbbdb0ec29
commit 5f680d7277
2 changed files with 11 additions and 0 deletions

View File

@ -14,6 +14,7 @@ if (isDev) {
if (devEnv.AllowIframe) process.env.ALLOW_IFRAME = '1'
if (devEnv.BackupPath) process.env.BACKUP_PATH = devEnv.BackupPath
if (devEnv.AllowPlugins) process.env.ALLOW_PLUGINS = '1'
if (devEnv.ExternalPluginPath) process.env.EXTERNAL_PLUGIN_PATH = devEnv.ExternalPluginPath
process.env.SOURCE = 'local'
process.env.ROUTER_BASE_PATH = devEnv.RouterBasePath || ''
}

View File

@ -161,6 +161,16 @@ class PluginManager {
pluginsFound.push(plugin)
}
}
if (process.env.EXTERNAL_PLUGIN_PATH) {
const pluginName = Path.basename(process.env.EXTERNAL_PLUGIN_PATH)
const plugin = await this.loadPlugin(pluginName, process.env.EXTERNAL_PLUGIN_PATH)
if (plugin) {
Logger.debug(`[PluginManager] Found external plugin "${plugin.manifest.name}"`)
pluginsFound.push(plugin)
} else {
Logger.error(`[PluginManager] External plugin not found or invalid`)
}
}
return pluginsFound
}