feat(scripts): pnpm work dispatch — wire CLI to dispatch.mjs
This commit is contained in:
@@ -114,7 +114,12 @@ function mark(status) {
|
||||
}
|
||||
|
||||
function usage() {
|
||||
console.log("Usage: pnpm work <rebuild-state|status|next|ready|blocked>");
|
||||
console.log(
|
||||
"Usage: pnpm work <rebuild-state|status|next|ready|blocked|dispatch>",
|
||||
);
|
||||
console.log(
|
||||
" dispatch Print the next dispatch plan (use --execute to invoke sandcastle)",
|
||||
);
|
||||
process.exit(2);
|
||||
}
|
||||
|
||||
@@ -124,4 +129,10 @@ else if (cmd === "status") printStatus();
|
||||
else if (cmd === "next") printNext();
|
||||
else if (cmd === "ready") printReady();
|
||||
else if (cmd === "blocked") printBlocked();
|
||||
else usage();
|
||||
else if (cmd === "dispatch") {
|
||||
// Re-dispatch to the dispatch script so it can handle its own --execute flag
|
||||
import("./dispatch.mjs").catch((e) => {
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
});
|
||||
} else usage();
|
||||
|
||||
@@ -51,4 +51,9 @@ describe("pnpm work cli", () => {
|
||||
const out = run("blocked");
|
||||
expect(out.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it("dispatch prints a plan", () => {
|
||||
const out = run("dispatch");
|
||||
expect(out).toContain("Dispatch plan");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user