mirror of
https://github.com/MatesMediaDev/JollyRipper-PluginsDirectory.git
synced 2026-05-30 08:21:24 +00:00
29 lines
710 B
JavaScript
29 lines
710 B
JavaScript
import { readdir, readFile, writeFile } from 'fs/promises';
|
|
import { join } from 'path';
|
|
|
|
const pluginsDir = './plugins';
|
|
|
|
async function updateIndex() {
|
|
const files = await readdir(pluginsDir);
|
|
const pluginIds = files
|
|
.filter(f => f.endsWith('.json') && f !== 'index.json')
|
|
.map(f => f.replace('.json', ''))
|
|
.sort();
|
|
|
|
const index = {
|
|
version: '1.0.0',
|
|
updatedAt: new Date().toISOString(),
|
|
plugins: pluginIds
|
|
};
|
|
|
|
await writeFile(
|
|
join(pluginsDir, 'index.json'),
|
|
JSON.stringify(index, null, 2) + '\n'
|
|
);
|
|
|
|
console.log(`✅ Updated index.json with ${pluginIds.length} plugins`);
|
|
console.log('Plugins:', pluginIds.join(', '));
|
|
}
|
|
|
|
updateIndex().catch(console.error);
|