fix: read file with dir

This commit is contained in:
H01001000
2023-03-08 19:52:33 -08:00
parent fdb65491f9
commit 3112007ed9
+1 -1
View File
@@ -9,7 +9,7 @@ const files = await fs.readdir('db/events')
await Promise.all(
files.map(async (file) => {
const eventsInFile = Object.values(await fs.readFile(file, 'utf8').then((text) => JSON.parse(text)))
const eventsInFile = Object.values(await fs.readFile(`db/events/${file}`, 'utf8').then((text) => JSON.parse(text)))
eventsInFile.forEach((eventInFile) => {
if (typeof eventInFile === 'string') return
events.push(eventInFile)