mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-19 04:14:46 +08:00
feat: add uploads
This commit is contained in:
@@ -43,13 +43,18 @@ export async function main() {
|
|||||||
"../backend/.deer-flow/threads",
|
"../backend/.deer-flow/threads",
|
||||||
threadId,
|
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)) {
|
if (fs.existsSync(outputsPath)) {
|
||||||
fs.cpSync(outputsPath, path.resolve(rootPath, "user-data/outputs"), {
|
fs.cpSync(outputsPath, path.resolve(rootPath, relPath), {
|
||||||
recursive: true,
|
recursive: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
console.info(`Saved demo "${title}" to ${rootPath}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
config();
|
config();
|
||||||
|
|||||||
Reference in New Issue
Block a user