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
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,14 @@ const copyTestData = async ( ...@@ -32,6 +32,14 @@ const copyTestData = async (
engine?: TemplateEngine, engine?: TemplateEngine,
openAIKey?: string, 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") { if (engine === "context" || framework === "fastapi") {
const srcPath = path.join(__dirname, "components", "data"); const srcPath = path.join(__dirname, "components", "data");
const destPath = path.join(root, "data"); const destPath = path.join(root, "data");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment