diff --git a/main.ts b/main.ts index 7cbebf2..887af60 100644 --- a/main.ts +++ b/main.ts @@ -18,8 +18,17 @@ const VERSION = 'v2' console.log('Prefetching pictures') await fetchRemoteFile('https://assets.tcgdex.net/datas.json') + // Cleanup await fs.rm(`./dist/${VERSION}/${lang}`, { force: true, recursive: true }) console.log('Let\'s GO !') + + // Process definitions + try { + await fs.mkdir(`./dist/${VERSION}/definitions`) + await fs.copyFile('./db/meta/definitions/openapi.yaml', `./dist/${VERSION}/definitions/openapi.yaml`) + } catch {} + + // process endpoints for await (const file of paths) { const path = `./endpoints/${file}` console.log(file, 'Running Init') diff --git a/utils/util.ts b/utils/util.ts index 31594f1..d9cf225 100644 --- a/utils/util.ts +++ b/utils/util.ts @@ -32,7 +32,7 @@ const globCache: Record> = {} export async function smartGlob(query: string): Promise> { if (!globCache[query]) { globCache[query] = await new Promise((res) => { - glob(query, (err, matches) => res(matches)) + glob(query, (_, matches) => res(matches)) }) } return globCache[query]