const listDir = require('@sukka/listdir'); const path = require('path'); const fs = require('fs'); const rootPath = path.resolve(__dirname, '../'); (async () => { const list = await listDir(rootPath, { ignoreHidden: true, ignorePattern: /node_modules|Build|.DS_Store|\.(json|html|md|js)|LICENSE/ }); const html = template(list); await fs.promises.writeFile(path.join(rootPath, 'index.html'), html, 'utf-8'); })(); /** * @param {string[]} urlList * @returns {string} */ function template(urlList) { return ` Surge Ruleset Server | Sukka (@SukkaW)

Sukka Surge Ruleset Server

Made by Sukka | Source @ GitHub | Licensed under AGPL-3.0

Last Updated: ${new Date().toISOString()}



` }