From 8c31afae7d7fcae09e99f01e6a198ddb954ce579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 6 Jan 2021 11:52:19 -0500 Subject: [PATCH] feat: #9173, show installed plugin versions in ./nodebb plugins --- src/cli/manage.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli/manage.js b/src/cli/manage.js index 2f541149c0..c986a2725f 100644 --- a/src/cli/manage.js +++ b/src/cli/manage.js @@ -77,7 +77,7 @@ async function listPlugins() { const active = await db.getSortedSetRange('plugins:active', 0, -1); // Merge the two sets, defer to plugins in `installed` if already present - let combined = installed.concat(active.reduce((memo, cur) => { + const combined = installed.concat(active.reduce((memo, cur) => { if (!installedList.includes(cur)) { memo.push({ id: cur, @@ -90,12 +90,12 @@ async function listPlugins() { }, [])); // Alphabetical sort - combined = combined.sort((a, b) => (a.id > b.id ? 1 : -1)); + combined.sort((a, b) => (a.id > b.id ? 1 : -1)); // Pretty output process.stdout.write('Active plugins:\n'); combined.forEach((plugin) => { - process.stdout.write('\t* ' + plugin.id + ' ('); + process.stdout.write('\t* ' + plugin.id + (plugin.version ? '@' + plugin.version : '') + ' ('); process.stdout.write(plugin.installed ? 'installed'.green : 'not installed'.red); process.stdout.write(', '); process.stdout.write(plugin.active ? 'enabled'.green : 'disabled'.yellow);