x.py: with --json-output, forward cargo's JSON
This commit is contained in:
parent
bb8674837a
commit
f507748ce4
1 changed files with 7 additions and 1 deletions
|
@ -983,7 +983,13 @@ pub fn stream_cargo(
|
|||
for line in stdout.lines() {
|
||||
let line = t!(line);
|
||||
match serde_json::from_str::<CargoMessage<'_>>(&line) {
|
||||
Ok(msg) => cb(msg),
|
||||
Ok(msg) => {
|
||||
if builder.config.json_output {
|
||||
// Forward JSON to stdout.
|
||||
println!("{}", line);
|
||||
}
|
||||
cb(msg)
|
||||
}
|
||||
// If this was informational, just print it out and continue
|
||||
Err(_) => println!("{}", line),
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue