mirror of
https://github.com/zadam/trilium.git
synced 2025-11-09 23:05:51 +01:00
moved all sources to src directory
This commit is contained in:
25
src/services/resource_dir.js
Normal file
25
src/services/resource_dir.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const log = require('./log');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
const RESOURCE_DIR = path.resolve(__dirname, "../..");
|
||||
|
||||
const DB_INIT_DIR = path.resolve(RESOURCE_DIR, "db");
|
||||
|
||||
if (!fs.existsSync(DB_INIT_DIR)) {
|
||||
log.error("Could not find DB initialization directory: " + DB_INIT_DIR);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const MIGRATIONS_DIR = path.resolve(DB_INIT_DIR, "migrations");
|
||||
|
||||
if (!fs.existsSync(MIGRATIONS_DIR)) {
|
||||
log.error("Could not find migration directory: " + MIGRATIONS_DIR);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
RESOURCE_DIR,
|
||||
MIGRATIONS_DIR,
|
||||
DB_INIT_DIR
|
||||
};
|
||||
Reference in New Issue
Block a user