From f6f6ea9d4c16c44f984ac0f4279638072821be7a Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Sat, 1 Jun 2024 11:19:24 +0200 Subject: [PATCH] Added compatibility with install-plugins script --- bin/plugins.ts | 23 +++++++++++++++++++---- package.json | 1 + 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/bin/plugins.ts b/bin/plugins.ts index 1b9d2d446..ee42e518a 100644 --- a/bin/plugins.ts +++ b/bin/plugins.ts @@ -12,11 +12,15 @@ if (process.argv.length === 2) { let args = process.argv.slice(2) -// 3d arg is ls, install or rm -let action = args[0]; - - +const possibleActions = [ + "i", + "install", + "rm", + "remove", + "ls", + "list" +] const install = ()=> { @@ -33,6 +37,9 @@ const install = ()=> { async function run() { for (const plugin of registryPlugins) { + if (possibleActions.includes(plugin)){ + continue + } console.log(`Installing plugin from registry: ${plugin}`) if (plugin.includes('@')) { const [name, version] = plugin.split('@'); @@ -81,6 +88,14 @@ const remove = (plugins: string[])=>{ })(); } +let action = args[0]; + +if (!possibleActions.includes(action)) { + // This is the old plugin install via install-plugins + console.warn("Using legacy plugin install. Please update to the new command `pnpm run plugins install `") + install() + process.exit(0) +} switch (action) { case "install": diff --git a/package.json b/package.json index a347c5e33..701204ed1 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "test-admin": "pnpm --filter ep_etherpad-lite run test-admin", "test-admin:ui": "pnpm --filter ep_etherpad-lite run test-admin:ui", "plugins": "pnpm --filter bin run plugins", + "install-plugins": "pnpm --filter bin run plugins", "remove-plugins": "pnpm --filter bin run remove-plugins", "list-plugins": "pnpm --filter bin run list-plugins" },