Skip to content
Snippets Groups Projects
Commit 7bd25b38 authored by Marcus Schiesser's avatar Marcus Schiesser
Browse files

fix: copy pdf-parse test doc for npm build

parent 3b1e326e
Branches
Tags
No related merge requests found
......@@ -32,6 +32,14 @@ const copyTestData = async (
engine?: TemplateEngine,
openAIKey?: string,
) => {
if (framework === "nextjs") {
// XXX: This is a hack to make the build for nextjs work with pdf-parse
// pdf-parse needs './test/data/05-versions-space.pdf' to exist - can be removed when pdf-parse is removed
const srcFile = path.join(__dirname, "components", "data", "101.pdf");
const destPath = path.join(root, "test", "data");
await fs.mkdir(destPath, { recursive: true });
await fs.copyFile(srcFile, path.join(destPath, "05-versions-space.pdf"));
}
if (engine === "context" || framework === "fastapi") {
const srcPath = path.join(__dirname, "components", "data");
const destPath = path.join(root, "data");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment