Skip to content

Commit a44b445

Browse files
committed
Read plugin name from package.json
1 parent c2ac126 commit a44b445

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/node/plugin.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ const loadPlugin = async (pluginPath: string, httpServer: HttpServer, args: Args
3535
const plugin: Plugin = require(pluginPath)
3636
plugin.activate(httpServer, args)
3737

38+
const packageJson = require(path.join(pluginPath, "package.json"))
3839
logger.debug(
3940
"Loaded plugin",
40-
field("name", path.basename(pluginPath)),
41-
field("version", require(path.join(pluginPath, "package.json")).version || "n/a"),
41+
field("name", packageJson.name || path.basename(pluginPath)),
42+
field("path", pluginPath),
43+
field("version", packageJson.version || "n/a"),
4244
)
4345
} catch (error) {
4446
logger.error(error.message)

0 commit comments

Comments
 (0)