未验证 提交 a44b4455 编写于 作者: A Asher

Read plugin name from package.json

上级 c2ac126a
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册