mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 07:35:05 -04:00
fix github plugin installation (#6584)
This commit is contained in:
parent
1393f338e0
commit
f8225b3e2a
4 changed files with 32 additions and 17 deletions
|
@ -23,17 +23,13 @@ const possibleActions = [
|
|||
]
|
||||
|
||||
const install = ()=> {
|
||||
|
||||
let registryPlugins: string[] = [];
|
||||
let localPlugins: string[] = [];
|
||||
|
||||
if (args.indexOf('--path') !== -1) {
|
||||
const indexToSplit = args.indexOf('--path');
|
||||
registryPlugins = args.slice(1, indexToSplit);
|
||||
localPlugins = args.slice(indexToSplit + 1);
|
||||
} else {
|
||||
registryPlugins = args;
|
||||
}
|
||||
const argsAsString: string = args.join(" ");
|
||||
const regexRegistryPlugins = /(?<=i\s)(.*?)(?=--github|--path|$)/;
|
||||
const regexLocalPlugins = /(?<=--path\s)(.*?)(?=--github|$)/;
|
||||
const regexGithubPlugins = /(?<=--github\s)(.*?)(?=--path|$)/;
|
||||
const registryPlugins = argsAsString.match(regexRegistryPlugins)?.[0]?.split(" ")?.filter(s => s) || [];
|
||||
const localPlugins = argsAsString.match(regexLocalPlugins)?.[0]?.split(" ")?.filter(s => s) || [];
|
||||
const githubPlugins = argsAsString.match(regexGithubPlugins)?.[0]?.split(" ")?.filter(s => s) || [];
|
||||
|
||||
async function run() {
|
||||
for (const plugin of registryPlugins) {
|
||||
|
@ -53,6 +49,11 @@ const install = ()=> {
|
|||
console.log(`Installing plugin from path: ${plugin}`);
|
||||
await linkInstaller.installFromPath(plugin);
|
||||
}
|
||||
|
||||
for (const plugin of githubPlugins) {
|
||||
console.log(`Installing plugin from github: ${plugin}`);
|
||||
await linkInstaller.installFromGitHub(plugin);
|
||||
}
|
||||
}
|
||||
|
||||
(async () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue