1
0
mirror of https://github.com/tcgdex/cards-database.git synced 2025-06-12 15:59:18 +00:00

feat: Add Prismatic Evolutions (#637)

This commit is contained in:
2025-01-18 01:56:17 +01:00
committed by GitHub
parent 33232f1b65
commit a33629e883
184 changed files with 10120 additions and 9 deletions

View File

@ -1,5 +1,5 @@
/* eslint-disable max-statements */
import { promises as fs } from 'fs'
import { existsSync, promises as fs } from 'fs'
import { SupportedLanguages } from '../../interfaces'
import { FileFunction } from './compilerInterfaces'
import { fetchRemoteFile, loadLastEdits } from './utils/util'
@ -37,8 +37,17 @@ const DIST_FOLDER = './generated'
// final folder path
const folder = `${DIST_FOLDER}/${lang}`
// console.log('files1:', await fs.readdir('.'))
// console.log('files2:', await fs.readdir(DIST_FOLDER))
// console.log('files3:', await fs.readdir(folder))
// Make the folder
await fs.mkdir(folder, {recursive: true})
try {
await fs.mkdir(folder, { recursive: true })
} catch {
// idk why it throws when file is present even if nodejs says it should not throw...
// maybe Bun changed how the throws works...
}
// Import the """Endpoint"""
const fn = (await import(`./endpoints/${file}`)).default as FileFunction