mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-05 06:37:10 -04:00
Added querying and removing plugins.
This commit is contained in:
parent
d9a0ecba53
commit
9a072bf36d
6 changed files with 64 additions and 17 deletions
|
@ -1,10 +1,8 @@
|
|||
'use strict';
|
||||
|
||||
import {writeFileSync} from 'fs'
|
||||
import {linkInstaller, installedPluginsPath} from "ep_etherpad-lite/static/js/pluginfw/installer";
|
||||
import {PackageData} from "ep_etherpad-lite/node/types/PackageInfo";
|
||||
import {persistInstalledPlugins} from "./commonPlugins";
|
||||
|
||||
const pluginsModule = require('ep_etherpad-lite/static/js/pluginfw/plugins');
|
||||
if (process.argv.length === 2) {
|
||||
console.error('Expected at least one argument!');
|
||||
process.exit(1);
|
||||
|
@ -23,18 +21,7 @@ if (args.indexOf('--path') !== -1) {
|
|||
registryPlugins = args;
|
||||
}
|
||||
|
||||
const persistInstalledPlugins = async () => {
|
||||
const plugins:PackageData[] = []
|
||||
const installedPlugins = {plugins: plugins};
|
||||
for (const pkg of Object.values(await pluginsModule.getPackages()) as PackageData[]) {
|
||||
installedPlugins.plugins.push({
|
||||
name: pkg.name,
|
||||
version: pkg.version,
|
||||
});
|
||||
}
|
||||
installedPlugins.plugins = [...new Set(installedPlugins.plugins)];
|
||||
writeFileSync(installedPluginsPath, JSON.stringify(installedPlugins));
|
||||
};
|
||||
|
||||
|
||||
async function run() {
|
||||
for (const plugin of registryPlugins) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue