31 lines
825 B
JavaScript
31 lines
825 B
JavaScript
import { execFileSync } from "node:child_process";
|
|
import { mkdir, rm } from "node:fs/promises";
|
|
import { fileURLToPath } from "node:url";
|
|
const root = fileURLToPath(new URL("../", import.meta.url));
|
|
execFileSync(process.execPath, ["ai-rules/robot-demand-parser-v1/export.mjs"], {
|
|
cwd: root,
|
|
stdio: "inherit",
|
|
});
|
|
await mkdir(new URL("../handoff/", import.meta.url), {
|
|
recursive: true,
|
|
});
|
|
await rm(new URL("../handoff/robot-demand-parser-v1.zip", import.meta.url), {
|
|
force: true,
|
|
});
|
|
execFileSync(
|
|
"zip",
|
|
[
|
|
"-qr",
|
|
"../handoff/robot-demand-parser-v1.zip",
|
|
"robot-demand-parser-v1",
|
|
"-x",
|
|
"*/.DS_Store",
|
|
"*/node_modules/*",
|
|
],
|
|
{
|
|
cwd: fileURLToPath(new URL("../ai-rules/", import.meta.url)),
|
|
stdio: "inherit",
|
|
},
|
|
);
|
|
console.log("已生成 handoff/robot-demand-parser-v1.zip");
|