make sure the DB is initiated
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
This commit is contained in:
@@ -1,13 +1,7 @@
|
||||
import Database from 'better-sqlite3';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { DB_FULLPATH } from '../../routes';
|
||||
|
||||
const fullPath = DB_FULLPATH;
|
||||
const dir = path.dirname(fullPath);
|
||||
// make sure the DB is initiated
|
||||
import '../../init/init_db'
|
||||
|
||||
if (!fs.existsSync(dir)) {
|
||||
fs.mkdirSync(dir);
|
||||
}
|
||||
|
||||
export const db = new Database(fullPath);
|
||||
export const db = new Database(DB_FULLPATH);
|
||||
|
||||
Reference in New Issue
Block a user