mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-08 08:01:02 -04:00
Also persist plugin version
This commit is contained in:
parent
42dbce66e3
commit
f5990ac04e
1 changed files with 7 additions and 4 deletions
|
@ -69,16 +69,19 @@ exports.checkForMigration = async () => {
|
||||||
const installedPlugins = JSON.parse(fileContent.toString());
|
const installedPlugins = JSON.parse(fileContent.toString());
|
||||||
|
|
||||||
for (const plugin of installedPlugins.plugins) {
|
for (const plugin of installedPlugins.plugins) {
|
||||||
if (plugin.startsWith(plugins.prefix) && plugin !== 'ep_etherpad-lite') {
|
if (plugin.name.startsWith(plugins.prefix) && plugin.name !== 'ep_etherpad-lite') {
|
||||||
await exports.manager.install(plugin)
|
await exports.manager.install(plugin.name, plugin.version)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const persistInstalledPlugins = async () => {
|
const persistInstalledPlugins = async () => {
|
||||||
let installedPlugins = { plugins: []};
|
let installedPlugins = { plugins: []};
|
||||||
for (const pkg of Object.keys(await plugins.getPackages())) {
|
for (const pkg of Object.values(await plugins.getPackages())) {
|
||||||
installedPlugins.plugins.push(pkg)
|
installedPlugins.plugins.push({
|
||||||
|
name: pkg.name,
|
||||||
|
version: pkg.version,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
installedPlugins.plugins = [...new Set(installedPlugins.plugins)];
|
installedPlugins.plugins = [...new Set(installedPlugins.plugins)];
|
||||||
await fs.writeFile(installedPluginsPath, JSON.stringify(installedPlugins));
|
await fs.writeFile(installedPluginsPath, JSON.stringify(installedPlugins));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue