From a44b4455f5f633bfaa66882d1e71777105c38134 Mon Sep 17 00:00:00 2001 From: Asher Date: Wed, 7 Oct 2020 12:54:40 -0500 Subject: [PATCH] Read plugin name from package.json --- src/node/plugin.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/node/plugin.ts b/src/node/plugin.ts index 2860763a..bd3765b6 100644 --- a/src/node/plugin.ts +++ b/src/node/plugin.ts @@ -35,10 +35,12 @@ const loadPlugin = async (pluginPath: string, httpServer: HttpServer, args: Args const plugin: Plugin = require(pluginPath) plugin.activate(httpServer, args) + const packageJson = require(path.join(pluginPath, "package.json")) logger.debug( "Loaded plugin", - field("name", path.basename(pluginPath)), - field("version", require(path.join(pluginPath, "package.json")).version || "n/a"), + field("name", packageJson.name || path.basename(pluginPath)), + field("path", pluginPath), + field("version", packageJson.version || "n/a"), ) } catch (error) { logger.error(error.message)