Merge branch 'feature/server_esm_part2' into feature/server_esm_part3

This commit is contained in:
Elian Doran
2024-07-23 19:15:59 +03:00
3 changed files with 6 additions and 6 deletions

View File

@@ -20,7 +20,7 @@ import AttachmentMeta from "../meta/attachment_meta.js";
import AttributeMeta from "../meta/attribute_meta.js";
import BBranch from "../../becca/entities/bbranch.js";
import { Response } from 'express';
import resource_dir from "../resource_dir.js";
import { RESOURCE_DIR } from "../resource_dir.js";
async function exportToZip(taskContext: TaskContext, branch: BBranch, format: "html" | "markdown", res: Response | fs.WriteStream, setHeaders = true) {
if (!['html', 'markdown'].includes(format)) {
@@ -473,7 +473,7 @@ ${markdownContent}`;
}
function saveCss(rootMeta: NoteMeta, cssMeta: NoteMeta) {
const cssContent = fs.readFileSync(`${resource_dir.RESOURCE_DIR}/libraries/ckeditor/ckeditor-content.css`);
const cssContent = fs.readFileSync(`${RESOURCE_DIR}/libraries/ckeditor/ckeditor-content.css`);
archive.append(cssContent, { name: cssMeta.dataFileName });
}

View File

@@ -3,7 +3,7 @@ import path from "path";
import fs from "fs";
import { fileURLToPath } from "url";
const RESOURCE_DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
export const RESOURCE_DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
// where the "trilium" executable is
const ELECTRON_APP_ROOT_DIR = path.resolve(RESOURCE_DIR, "../..");