pluginfw: In-line `formatPluginsWithVersion()`

There's only one caller of the function, so move the logic to where it
is used.
pull/4675/head^2
Richard Hansen 2021-02-03 23:19:21 -05:00 committed by John McLear
parent cd1d322af4
commit 746cc8cc34
2 changed files with 6 additions and 6 deletions

View File

@ -44,6 +44,7 @@ const db = require('./db/DB');
const express = require('./hooks/express');
const hooks = require('../static/js/pluginfw/hooks');
const npm = require('npm/lib/npm.js');
const pluginDefs = require('../static/js/pluginfw/plugin_defs');
const plugins = require('../static/js/pluginfw/plugins');
const settings = require('./utils/Settings');
const util = require('util');
@ -120,7 +121,11 @@ exports.start = async () => {
await util.promisify(npm.load)();
await db.init();
await plugins.update();
console.info(`Installed plugins: ${plugins.formatPluginsWithVersion()}`);
const installedPlugins = Object.values(pluginDefs.plugins)
.filter((plugin) => plugin.package.name !== 'ep_etherpad-lite')
.map((plugin) => `${plugin.package.name}@${plugin.package.version}`)
.join(', ');
console.info(`Installed plugins: ${installedPlugins}`);
console.debug(`Installed parts:\n${plugins.formatParts()}`);
console.debug(`Installed hooks:\n${plugins.formatHooks()}`);
await hooks.aCallAll('loadSettings', {settings});

View File

@ -15,11 +15,6 @@ exports.prefix = 'ep_';
exports.formatPlugins = () => Object.keys(defs.plugins).join(', ');
exports.formatPluginsWithVersion = () => Object.values(defs.plugins)
.filter((plugin) => plugin.package.name !== 'ep_etherpad-lite')
.map((plugin) => `${plugin.package.name}@${plugin.package.version}`)
.join(', ');
exports.formatParts = () => defs.parts.map((part) => part.full_name).join('\n');
exports.formatHooks = (hookSetName) => {