From 3a1157a68a70e90df21f743ea15154805649b8e5 Mon Sep 17 00:00:00 2001 From: John Livingston <38844060+JohnXLivingston@users.noreply.github.com> Date: Fri, 3 Dec 2021 10:14:01 +0100 Subject: CLI: plugins install command accept a --plugin-version parameter. (#4599) * CLI: plugins install command accept a --plugin-version parameter. * Unit tests for plugins install --plugin-version. * Fix linting. * Styling Co-authored-by: Chocobozzz --- server/controllers/api/plugins.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'server/controllers/api') diff --git a/server/controllers/api/plugins.ts b/server/controllers/api/plugins.ts index 2de7fe41f..de9e055dc 100644 --- a/server/controllers/api/plugins.ts +++ b/server/controllers/api/plugins.ts @@ -144,8 +144,13 @@ async function installPlugin (req: express.Request, res: express.Response) { const fromDisk = !!body.path const toInstall = body.npmName || body.path + + const pluginVersion = body.pluginVersion && body.npmName + ? body.pluginVersion + : undefined + try { - const plugin = await PluginManager.Instance.install(toInstall, undefined, fromDisk) + const plugin = await PluginManager.Instance.install(toInstall, pluginVersion, fromDisk) return res.json(plugin.toFormattedJSON()) } catch (err) { -- cgit v1.2.3