Skip to content

Commit e12af3e

Browse files
committed
tests - correctly handle finding output in project of type default
1 parent a8a17d0 commit e12af3e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tests/utils.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,8 @@ export function findProjectOutputDir(projectdir: string | undefined) {
6262
if (type === "manuscript") {
6363
return (yaml as any)?.project?.["output-dir"] || "_manuscript";
6464
}
65-
if (type === "default") {
66-
return (yaml as any)?.project?.["output-dir"];
67-
}
68-
return (yaml as any)?.project?.["output-dir"];
65+
// type default explicit or just unset
66+
return (yaml as any)?.project?.["output-dir"] || "";
6967
}
7068

7169
// Gets output that should be created for this input file and target format
@@ -142,10 +140,10 @@ export function outputForInput(
142140
}
143141
}
144142

145-
const outputPath: string = projectRoot && projectOutDir
143+
const outputPath: string = projectRoot && projectOutDir !== undefined
146144
? join(projectRoot, projectOutDir, dir, `${stem}.${outputExt}`)
147145
: join(dir, `${stem}.${outputExt}`);
148-
const supportPath: string = projectRoot && projectOutDir
146+
const supportPath: string = projectRoot && projectOutDir !== undefined
149147
? join(projectRoot, projectOutDir, dir, `${stem}_files`)
150148
: join(dir, `${stem}_files`);
151149

0 commit comments

Comments
 (0)