diff --git a/frontend/scripts/save-demo.js b/frontend/scripts/save-demo.js index c987bf7..a46135a 100644 --- a/frontend/scripts/save-demo.js +++ b/frontend/scripts/save-demo.js @@ -43,13 +43,18 @@ export async function main() { "../backend/.deer-flow/threads", threadId, ); - const outputsPath = path.resolve(backendRootPath, "user-data/outputs"); + copyFolder("user-data/outputs", rootPath, backendRootPath); + copyFolder("user-data/uploads", rootPath, backendRootPath); + console.info(`Saved demo "${title}" to ${rootPath}`); +} + +function copyFolder(relPath, rootPath, backendRootPath) { + const outputsPath = path.resolve(backendRootPath, relPath); if (fs.existsSync(outputsPath)) { - fs.cpSync(outputsPath, path.resolve(rootPath, "user-data/outputs"), { + fs.cpSync(outputsPath, path.resolve(rootPath, relPath), { recursive: true, }); } - console.info(`Saved demo "${title}" to ${rootPath}`); } config();