Files
agent-desktop/console/scripts/copy-console.mjs
T
Pine 9b30f681c6 feat: 智能体控制台前端(console)
- React+antd+zustand,注册表驱动路由/菜单/权限
- Tauri 桌面壳、后端托管 SPA、跨标签页消息队列
2026-08-23 22:43:18 +08:00

30 lines
1.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 构建后把 console 的 dist/ 产物复制到后端静态目录 ../src/pineagents/console
// 替换旧资源。由 console/package.json 的 build 脚本在每次编译完成后调用。
import { cp, mkdir, rm } from "node:fs/promises";
import { access } from "node:fs/promises";
import { fileURLToPath } from "node:url";
import path from "node:path";
const here = path.dirname(fileURLToPath(import.meta.url));
const distDir = path.resolve(here, "../dist");
const targetDir = path.resolve(here, "../../src/pineagents/console");
async function main() {
try {
await access(distDir);
} catch {
console.error(`[copy-console] dist 不存在: ${distDir}`);
process.exit(1);
}
await rm(targetDir, { recursive: true, force: true });
await mkdir(targetDir, { recursive: true });
await cp(distDir, targetDir, { recursive: true });
console.log(`[copy-console] 已复制 ${distDir} -> ${targetDir}`);
}
main().catch((err) => {
console.error("[copy-console] 复制失败:", err);
process.exit(1);
});