17 lines
573 B
JavaScript
17 lines
573 B
JavaScript
import fs from 'fs'
|
|
import path from 'path'
|
|
import { fileURLToPath } from 'url'
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
|
|
const dropsDir = path.join(__dirname, '../app/public/drops')
|
|
const outputPath = path.join(__dirname, '../app/public/manifest.json')
|
|
|
|
const dropNames = fs
|
|
.readdirSync(dropsDir, { withFileTypes: true })
|
|
.filter((dirent) => dirent.isDirectory())
|
|
.map((dirent) => dirent.name)
|
|
|
|
fs.writeFileSync(outputPath, JSON.stringify(dropNames, null, 2))
|
|
|
|
console.log(`Manifest created with ${dropNames.length} drops:`, dropNames)
|