1
0
mirror of https://github.com/tcgdex/cards-database.git synced 2025-04-23 19:32:11 +00:00

fix: Fixed DB path (#134)

* Fixed path

Signed-off-by: Avior <github@avior.me>

* Fixed Builder

Signed-off-by: Avior <github@avior.me>
This commit is contained in:
Florian Bouillon 2021-11-04 11:51:09 +01:00 committed by GitHub
parent 65e5bdb9ee
commit 40240f2ab9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -21,7 +21,7 @@ export async function getSet(name: string, serie = '*'): Promise<Set> {
if (!setCache[name]) { if (!setCache[name]) {
try { try {
const [path] = await smartGlob(`${DB_PATH}/data/${serie}/${name}.js`) const [path] = await smartGlob(`${DB_PATH}/data/${serie}/${name}.js`)
setCache[name] = (await import('../../' + path)).default setCache[name] = (await import(`../../${path}`)).default
} catch (error) { } catch (error) {
console.error(error) console.error(error)
console.error(`Error trying to import importing (${`db/data/${serie}/${name}.js`})`) console.error(`Error trying to import importing (${`db/data/${serie}/${name}.js`})`)

View File

@ -7,7 +7,7 @@ interface fileCacheInterface {
[key: string]: any [key: string]: any
} }
export const DB_PATH = "../../" export const DB_PATH = "../"
const fileCache: fileCacheInterface = {} const fileCache: fileCacheInterface = {}

View File

@ -5,7 +5,7 @@
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"compile": "ts-node compiler/index.ts", "compile": "ts-node --project ../tsconfig.json compiler/index.ts",
"dev": "ts-node-dev -T src/index.ts", "dev": "ts-node-dev -T src/index.ts",
"build": "tsc --project tsconfig.json", "build": "tsc --project tsconfig.json",
"start": "node dist/index.js" "start": "node dist/index.js"

View File

@ -1,5 +1,5 @@
{ {
"include": ["data", "interfaces.d.ts"], "include": ["data", "server/compiler", "interfaces.d.ts"],
"compilerOptions": { "compilerOptions": {
"target": "es5", "target": "es5",
"module": "commonjs", "module": "commonjs",