Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
} from "./client/index.js";
import { handleError } from "./error-handler.js";
import { createTransport, TransportOptions } from "./transport.js";
import { awaitableLog } from "./utils/awaitable-log.js";

// JSON value type for CLI arguments
type JsonValue =
Expand Down Expand Up @@ -167,7 +168,7 @@ async function callMethod(args: Args): Promise<void> {
);
}

console.log(JSON.stringify(result, null, 2));
await awaitableLog(JSON.stringify(result, null, 2));
} finally {
try {
await disconnect(transport);
Expand Down
7 changes: 7 additions & 0 deletions cli/src/utils/awaitable-log.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export function awaitableLog(logValue: string): Promise<void> {
return new Promise<void>((resolve) => {
process.stdout.write(logValue, () => {
resolve();
});
});
}