trilium/apps/server/src/services/resource_dir.ts
Elian Doran 8994f537dc
fix(migration): use bundleable migrations
This fixes TypeScript migrations, which were not being run correctly
even in previous versions.

On the ESBuild version, neither SQL migrations worked due to the fact
that they were not being bundled.
2025-05-30 21:32:35 +03:00

22 lines
564 B
TypeScript

import log from "./log.js";
import path from "path";
import fs from "fs";
import { getResourceDir } from "./utils.js";
export const RESOURCE_DIR = path.join(getResourceDir(), "assets");
// where the "trilium" executable is
const ELECTRON_APP_ROOT_DIR = path.resolve(RESOURCE_DIR, "../..");
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);
}
export default {
RESOURCE_DIR,
DB_INIT_DIR,
ELECTRON_APP_ROOT_DIR
};