File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import {
1919} from "./client/index.js" ;
2020import { handleError } from "./error-handler.js" ;
2121import { createTransport , TransportOptions } from "./transport.js" ;
22+ import { awaitableLog } from "./utils/awaitable-log.js" ;
2223
2324// JSON value type for CLI arguments
2425type JsonValue =
@@ -167,7 +168,7 @@ async function callMethod(args: Args): Promise<void> {
167168 ) ;
168169 }
169170
170- console . log ( JSON . stringify ( result , null , 2 ) ) ;
171+ await awaitableLog ( JSON . stringify ( result , null , 2 ) ) ;
171172 } finally {
172173 try {
173174 await disconnect ( transport ) ;
Original file line number Diff line number Diff line change 1+ export function awaitableLog ( logValue : string ) : Promise < void > {
2+ return new Promise < void > ( ( resolve ) => {
3+ process . stdout . write ( logValue , ( ) => {
4+ resolve ( ) ;
5+ } ) ;
6+ } ) ;
7+ }
You can’t perform that action at this time.
0 commit comments