Files
2026-04-19 03:31:23 +10:00

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);