Skip to content

Commit 615ac64

Browse files
committed
fix(cli): flush output stream on CLI output
For some reason, this is now a requirement - previously this didn't seem to be necessary. Don't know what changed there ... and it's odd it doesn't flush when the process is going down or the handle is destroyed.
1 parent d0491a4 commit 615ac64

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/mako/cli/lib/engine.mako

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,15 @@ if dry_run {
326326
let mut value = json::value::to_value(&output_schema);
327327
remove_json_null_values(&mut value);
328328
json::to_writer_pretty(&mut ostream, &value).unwrap();
329+
ostream.flush().unwrap();
329330
% endif
330331
% if track_download_flag:
331332
} else {
332333
% endif
333334
% if supports_media_download:
334335
## Download is the only option - nothing else matters
335336
io::copy(&mut response, &mut ostream).unwrap();
337+
ostream.flush().unwrap();
336338
% endif
337339
% if track_download_flag:
338340
}

0 commit comments

Comments
 (0)