mirror of
https://github.com/denoland/deno.git
synced 2024-11-22 15:06:54 -05:00
fix(cli): output json with trailing newline character (#10830)
This commit is contained in:
parent
03184aeabb
commit
41e9a21307
5 changed files with 8 additions and 6 deletions
|
@ -261,8 +261,10 @@ pub fn write_json_to_stdout<T>(value: &T) -> Result<(), AnyError>
|
||||||
where
|
where
|
||||||
T: ?Sized + serde::ser::Serialize,
|
T: ?Sized + serde::ser::Serialize,
|
||||||
{
|
{
|
||||||
let writer = std::io::BufWriter::new(std::io::stdout());
|
let mut writer = std::io::BufWriter::new(std::io::stdout());
|
||||||
serde_json::to_writer_pretty(writer, value).map_err(AnyError::from)
|
serde_json::to_writer_pretty(&mut writer, value)?;
|
||||||
|
writeln!(&mut writer)?;
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn print_cache_info(
|
fn print_cache_info(
|
||||||
|
|
|
@ -53,4 +53,4 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"size": 757
|
"size": 757
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,4 +82,4 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"size": 475
|
"size": 475
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,4 +4,4 @@
|
||||||
"typescriptCache": "[WILDCARD]gen",
|
"typescriptCache": "[WILDCARD]gen",
|
||||||
"registryCache": "[WILDCARD]registries",
|
"registryCache": "[WILDCARD]registries",
|
||||||
"originStorage": "[WILDCARD]location_data"
|
"originStorage": "[WILDCARD]location_data"
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,4 +5,4 @@
|
||||||
"registryCache": "[WILDCARD]registries",
|
"registryCache": "[WILDCARD]registries",
|
||||||
"originStorage": "[WILDCARD]location_data[WILDCARD]",
|
"originStorage": "[WILDCARD]location_data[WILDCARD]",
|
||||||
"localStorage": "[WILDCARD]location_data[WILDCARD]local_storage"
|
"localStorage": "[WILDCARD]location_data[WILDCARD]local_storage"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue