Skip to content

Commit 0140417

Browse files
implement and use quartoConfig.srcPath()
1 parent 94c9cd1 commit 0140417

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/command/render/pandoc.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,9 +1602,7 @@ async function resolveExtras(
16021602
}
16031603
fontdirs.add(font_cache);
16041604
}
1605-
const srcDir = Deno.env.get("QUARTO_SRC_PATH") ||
1606-
join(quartoConfig.sharePath(), "../../src");
1607-
fontdirs.add(join(srcDir,'resources/fonts'));
1605+
fontdirs.add(join(quartoConfig.srcPath(), "resources/fonts"));
16081606
let fontPaths = format.metadata[kFontPaths] as Array<string> || [];
16091607
if (typeof fontPaths === "string") {
16101608
fontPaths = [fontPaths];

src/core/devconfig.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ export function createDevConfig(
3838
scriptDir: string,
3939
): DevConfig {
4040
const scriptPath = join(scriptDir, "quarto" + (isWindows ? ".cmd" : ""));
41-
const srcDir = Deno.env.get("QUARTO_SRC_PATH") ||
42-
join(quartoConfig.sharePath(), "../../src");
41+
const srcDir = quartoConfig.srcPath();
4342
return {
4443
deno,
4544
deno_dom,

src/core/quarto.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ export const quartoConfig = {
3131
binPath: () => getenv("QUARTO_BIN_PATH"),
3232
toolsPath: () => join(getenv("QUARTO_BIN_PATH"), "tools"),
3333
sharePath: () => getenv("QUARTO_SHARE_PATH"),
34+
srcPath: () =>
35+
getenv("QUARTO_SRC_PATH", "") ||
36+
normalizePath(join(quartoConfig.sharePath(), "../../src")),
3437
isDebug: () => getenv("QUARTO_DEBUG", "false") === "true",
3538
version: () => {
3639
const forceVersion = getenv("QUARTO_FORCE_VERSION", "");

0 commit comments

Comments
 (0)