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:
parent
65e5bdb9ee
commit
40240f2ab9
@ -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`})`)
|
||||||
|
@ -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 = {}
|
||||||
|
|
||||||
|
@ -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"
|
||||||
|
@ -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",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user