mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-22 06:32:00 +00:00
refactor(cli): separate json payload output from logging
This commit is contained in:
@@ -160,7 +160,7 @@ export function registerDirectoryCli(program: Command) {
|
||||
runtime: defaultRuntime,
|
||||
});
|
||||
if (params.opts.json) {
|
||||
defaultRuntime.log(JSON.stringify(result, null, 2));
|
||||
defaultRuntime.writeJson(result);
|
||||
return;
|
||||
}
|
||||
printDirectoryList({ title: params.title, emptyMessage: params.emptyMessage, entries: result });
|
||||
@@ -179,7 +179,7 @@ export function registerDirectoryCli(program: Command) {
|
||||
}
|
||||
const result = await fn({ cfg, accountId, runtime: defaultRuntime });
|
||||
if (opts.json) {
|
||||
defaultRuntime.log(JSON.stringify(result, null, 2));
|
||||
defaultRuntime.writeJson(result);
|
||||
return;
|
||||
}
|
||||
if (!result) {
|
||||
@@ -272,7 +272,7 @@ export function registerDirectoryCli(program: Command) {
|
||||
runtime: defaultRuntime,
|
||||
});
|
||||
if (opts.json) {
|
||||
defaultRuntime.log(JSON.stringify(result, null, 2));
|
||||
defaultRuntime.writeJson(result);
|
||||
return;
|
||||
}
|
||||
printDirectoryList({
|
||||
|
||||
Reference in New Issue
Block a user