mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-29 18:52:15 +00:00
fix(cli): keep nodes json stdout clean (#84423)
Co-authored-by: Gio Della-Libera <giodl@microsoft.com>
This commit is contained in:
@@ -127,11 +127,15 @@ const entrySpecs: readonly CommandGroupDescriptorSpec<SubCliRegistrar>[] = [
|
||||
loadModule: () => import("../exec-policy-cli.js"),
|
||||
exportName: "registerExecPolicyCli",
|
||||
},
|
||||
{
|
||||
commandNames: ["nodes"],
|
||||
loadModule: () => import("../nodes-cli.js"),
|
||||
exportName: "registerNodesCli",
|
||||
]),
|
||||
{
|
||||
commandNames: ["nodes"],
|
||||
register: async (program, argv) => {
|
||||
const mod = await import("../nodes-cli.js");
|
||||
await mod.registerNodesCli(program, argv);
|
||||
},
|
||||
},
|
||||
...defineImportedProgramCommandGroupSpecs([
|
||||
{
|
||||
commandNames: ["devices"],
|
||||
loadModule: () => import("../devices-cli.js"),
|
||||
|
||||
@@ -172,6 +172,12 @@ describe("registerSubCliCommands", () => {
|
||||
await program.parseAsync(["nodes", "list"], { from: "user" });
|
||||
|
||||
expect(registerNodesCli).toHaveBeenCalledTimes(1);
|
||||
expect(registerNodesCli).toHaveBeenCalledWith(expect.any(Command), [
|
||||
"node",
|
||||
"openclaw",
|
||||
"nodes",
|
||||
"list",
|
||||
]);
|
||||
expect(nodesAction).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user