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" },