mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 06:03:34 +01:00
Added compatibility with install-plugins script
This commit is contained in:
parent
c67be391f2
commit
f6f6ea9d4c
2 changed files with 20 additions and 4 deletions
|
@ -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 <your-plugin>`")
|
||||
install()
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
switch (action) {
|
||||
case "install":
|
||||
|
|
|
@ -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"
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue