mirror of https://git.tuxpa.in/a/code-server.git
Read plugin name from package.json
This commit is contained in:
parent
c2ac126a50
commit
a44b4455f5
|
@ -35,10 +35,12 @@ const loadPlugin = async (pluginPath: string, httpServer: HttpServer, args: Args
|
||||||
const plugin: Plugin = require(pluginPath)
|
const plugin: Plugin = require(pluginPath)
|
||||||
plugin.activate(httpServer, args)
|
plugin.activate(httpServer, args)
|
||||||
|
|
||||||
|
const packageJson = require(path.join(pluginPath, "package.json"))
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"Loaded plugin",
|
"Loaded plugin",
|
||||||
field("name", path.basename(pluginPath)),
|
field("name", packageJson.name || path.basename(pluginPath)),
|
||||||
field("version", require(path.join(pluginPath, "package.json")).version || "n/a"),
|
field("path", pluginPath),
|
||||||
|
field("version", packageJson.version || "n/a"),
|
||||||
)
|
)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error(error.message)
|
logger.error(error.message)
|
||||||
|
|
Loading…
Reference in New Issue