fix(share): template directory in production
Some checks are pending
Checks / main (push) Waiting to run

This commit is contained in:
Elian Doran 2025-10-26 21:38:16 +02:00
parent ba26c478d6
commit 52a6f2597e
No known key found for this signature in database

View File

@ -9,7 +9,7 @@ import type BBranch from "../becca/entities/bbranch.js";
import { t } from "i18next"; import { t } from "i18next";
import SBranch from "./shaca/entities/sbranch.js"; import SBranch from "./shaca/entities/sbranch.js";
import options from "../services/options.js"; import options from "../services/options.js";
import utils, { isDev, safeExtractMessageAndStackFromError } from "../services/utils.js"; import utils, { getResourceDir, isDev, safeExtractMessageAndStackFromError } from "../services/utils.js";
import ejs from "ejs"; import ejs from "ejs";
import log from "../services/log.js"; import log from "../services/log.js";
import { join } from "path"; import { join } from "path";
@ -199,7 +199,7 @@ function getDefaultTemplatePath(template: string) {
// Path is relative to apps/server/dist/assets/views // Path is relative to apps/server/dist/assets/views
return process.env.NODE_ENV === "development" return process.env.NODE_ENV === "development"
? join(__dirname, `../../../../packages/share-theme/src/templates/${template}.ejs`) ? join(__dirname, `../../../../packages/share-theme/src/templates/${template}.ejs`)
: `../../share-theme/templates/${template}.ejs`; : join(getResourceDir(), `share-theme/templates/${template}.ejs`);
} }
function readTemplate(path: string) { function readTemplate(path: string) {