mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +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)
|
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 = ()=> {
|
const install = ()=> {
|
||||||
|
|
||||||
|
@ -33,6 +37,9 @@ const install = ()=> {
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
for (const plugin of registryPlugins) {
|
for (const plugin of registryPlugins) {
|
||||||
|
if (possibleActions.includes(plugin)){
|
||||||
|
continue
|
||||||
|
}
|
||||||
console.log(`Installing plugin from registry: ${plugin}`)
|
console.log(`Installing plugin from registry: ${plugin}`)
|
||||||
if (plugin.includes('@')) {
|
if (plugin.includes('@')) {
|
||||||
const [name, version] = plugin.split('@');
|
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) {
|
switch (action) {
|
||||||
case "install":
|
case "install":
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
"test-admin": "pnpm --filter ep_etherpad-lite run test-admin",
|
"test-admin": "pnpm --filter ep_etherpad-lite run test-admin",
|
||||||
"test-admin:ui": "pnpm --filter ep_etherpad-lite run test-admin:ui",
|
"test-admin:ui": "pnpm --filter ep_etherpad-lite run test-admin:ui",
|
||||||
"plugins": "pnpm --filter bin run plugins",
|
"plugins": "pnpm --filter bin run plugins",
|
||||||
|
"install-plugins": "pnpm --filter bin run plugins",
|
||||||
"remove-plugins": "pnpm --filter bin run remove-plugins",
|
"remove-plugins": "pnpm --filter bin run remove-plugins",
|
||||||
"list-plugins": "pnpm --filter bin run list-plugins"
|
"list-plugins": "pnpm --filter bin run list-plugins"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue