From 0117c703726dc179b2b7aa3e4f718a421e5b15f2 Mon Sep 17 00:00:00 2001 From: Tim 'Piepmatz' Hesse Date: Mon, 23 Dec 2024 16:36:52 +0100 Subject: [PATCH] add content type metadata to `config nu` commands --- crates/nu-command/src/env/config/config_nu.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/crates/nu-command/src/env/config/config_nu.rs b/crates/nu-command/src/env/config/config_nu.rs index 5295fe5247..ee09965aa6 100644 --- a/crates/nu-command/src/env/config/config_nu.rs +++ b/crates/nu-command/src/env/config/config_nu.rs @@ -1,4 +1,5 @@ use nu_engine::command_prelude::*; +use nu_protocol::PipelineMetadata; #[derive(Clone)] pub struct ConfigNu; @@ -70,13 +71,21 @@ impl Command for ConfigNu { // `--default` flag handling if default_flag { let head = call.head; - return Ok(Value::string(nu_utils::get_default_config(), head).into_pipeline_data()); + return Ok(Value::string(nu_utils::get_default_config(), head) + .into_pipeline_data_with_metadata( + PipelineMetadata::default() + .with_content_type("application/x-nuscript".to_string().into()), + )); } // `--doc` flag handling if doc_flag { let head = call.head; - return Ok(Value::string(nu_utils::get_doc_config(), head).into_pipeline_data()); + return Ok(Value::string(nu_utils::get_doc_config(), head) + .into_pipeline_data_with_metadata( + PipelineMetadata::default() + .with_content_type("application/x-nuscript".to_string().into()), + )); } super::config_::start_editor("config-path", engine_state, stack, call)