summaryrefslogtreecommitdiff
path: root/cli/tools/info.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-09-26 15:57:12 -0400
committerGitHub <noreply@github.com>2024-09-26 15:57:12 -0400
commit7cccb7422bb9be7a2e87d71ca59c8dabd32c07ec (patch)
tree2e3564ef57220db130dca41dfd92f72ac5bb5dd6 /cli/tools/info.rs
parent543c687c3474233d674ba9938c40c9a33fab61e8 (diff)
fix(info): move "version" field to top of json output (#25890)
Diffstat (limited to 'cli/tools/info.rs')
-rw-r--r--cli/tools/info.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/cli/tools/info.rs b/cli/tools/info.rs
index b92887d53..1c83abe3b 100644
--- a/cli/tools/info.rs
+++ b/cli/tools/info.rs
@@ -82,7 +82,11 @@ pub async fn info(
if info_flags.json {
let mut json_graph = serde_json::json!(graph);
if let Some(output) = json_graph.as_object_mut() {
- output.insert("version".to_string(), JSON_SCHEMA_VERSION.into());
+ output.shift_insert(
+ 0,
+ "version".to_string(),
+ JSON_SCHEMA_VERSION.into(),
+ );
}
add_npm_packages_to_json(&mut json_graph, npm_resolver.as_ref());
display::write_json_to_stdout(&json_graph)?;