Acquire installed portable operations with explicit authority and input coverage
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env node
|
||||
import { readFile, writeFile } from "node:fs/promises";
|
||||
import { generatePortableClientBindings } from "./portable-client.js";
|
||||
async function main() {
|
||||
const [plan, output, target = "browser", ...rest] = process.argv.slice(2);
|
||||
if (!plan || !output || rest.length)
|
||||
throw Error("usage: quixos-codegen-client EXECUTION_PLAN.json OUTPUT.ts [TARGET]");
|
||||
await writeFile(output, generatePortableClientBindings(JSON.parse(await readFile(plan, "utf8")), { target }));
|
||||
}
|
||||
void main().catch((error) => {
|
||||
console.error(error instanceof Error ? error.message : error);
|
||||
process.exitCode = 1;
|
||||
});
|
||||
Reference in New Issue
Block a user