mike-backend / backend /scripts /export-builtin-workflows.mjs
bardd's picture
Deploy Mike backend-only Space
06671aa verified
Raw History Blame Contribute Delete
791 Bytes
#!/usr/bin/env node
/**
* Single workflow export script — reads backend canonical sources and writes
* frontend/src/generated/builtin-workflows.json.
*/
import { spawnSync } from "node:child_process";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
const __dirname = dirname(fileURLToPath(import.meta.url));
const BACKEND = join(__dirname, "..");
const runner = join(BACKEND, "scripts/lib/assemble-builtin-workflows-for-export.ts");
const result = spawnSync("npx", ["tsx", runner], {
cwd: BACKEND,
encoding: "utf8",
stdio: ["ignore", "pipe", "pipe"],
});
if (result.stdout) process.stdout.write(result.stdout);
if (result.stderr) process.stderr.write(result.stderr);
if (result.status !== 0) {
process.exit(result.status ?? 1);
}