Skip to content

Commit

Permalink
fix(cli): flush output stream on CLI output
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Byron committed Jun 26, 2015
1 parent d0491a4 commit 615ac64
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mako/cli/lib/engine.mako
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,15 @@ if dry_run {
let mut value = json::value::to_value(&output_schema);
remove_json_null_values(&mut value);
json::to_writer_pretty(&mut ostream, &value).unwrap();
ostream.flush().unwrap();
% endif
% if track_download_flag:
} else {
% endif
% if supports_media_download:
## Download is the only option - nothing else matters
io::copy(&mut response, &mut ostream).unwrap();
ostream.flush().unwrap();
% endif
% if track_download_flag:
}
Expand Down

0 comments on commit 615ac64

Please sign in to comment.