From 7c91b879da7ff0ecf0f2cab0491ca03de8347627 Mon Sep 17 00:00:00 2001 From: John Hooks Date: Sat, 30 Mar 2024 20:38:34 -0400 Subject: [PATCH] set disabled to true --- .github/config-schema.json | 8 ++++---- src/configs/nats.rs | 2 +- src/configs/starship_root.rs | 2 +- src/modules/nats.rs | 6 ++++++ 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/config-schema.json b/.github/config-schema.json index 703c7ac41ae5f..919c48423da49 100644 --- a/.github/config-schema.json +++ b/.github/config-schema.json @@ -1024,8 +1024,8 @@ }, "nats": { "default": { - "disabled": false, - "format": "$name($style)", + "disabled": true, + "format": "[$symbol$name]($style)", "style": "bold purple", "symbol": "" }, @@ -4384,7 +4384,7 @@ "type": "object", "properties": { "format": { - "default": "$name($style)", + "default": "[$symbol$name]($style)", "type": "string" }, "symbol": { @@ -4396,7 +4396,7 @@ "type": "string" }, "disabled": { - "default": false, + "default": true, "type": "boolean" } }, diff --git a/src/configs/nats.rs b/src/configs/nats.rs index 3b6e1f41c9b7f..cad14413b6190 100644 --- a/src/configs/nats.rs +++ b/src/configs/nats.rs @@ -20,7 +20,7 @@ impl<'a> Default for NatsConfig<'a> { format: "[$symbol$name]($style)", symbol: "", style: "bold purple", - disabled: false, + disabled: true, } } } diff --git a/src/configs/starship_root.rs b/src/configs/starship_root.rs index b7a671d017978..4d97dd4763a32 100644 --- a/src/configs/starship_root.rs +++ b/src/configs/starship_root.rs @@ -37,6 +37,7 @@ pub const PROMPT_ORDER: &[&str] = &[ "shlvl", "singularity", "kubernetes", + "nats", "directory", "vcsh", "fossil_branch", @@ -74,7 +75,6 @@ pub const PROMPT_ORDER: &[&str] = &[ "kotlin", "lua", "nim", - "nats", "nodejs", "ocaml", "opa", diff --git a/src/modules/nats.rs b/src/modules/nats.rs index eddbd96689652..444f2c00ef103 100644 --- a/src/modules/nats.rs +++ b/src/modules/nats.rs @@ -8,6 +8,10 @@ pub fn module<'a>(context: &'a Context) -> Option> { let mut module = context.new_module("nats"); let config = NatsConfig::try_load(module.config); + if config.disabled { + return None; + }; + let ctx_str = context .exec_cmd("nats", &["context", "info", "--json"])? .stdout; @@ -59,6 +63,7 @@ mod tests { [nats] format = \"[$symbol$name](bold purple)\" symbol = \"\" + disabled = false " )) .unwrap(), @@ -78,6 +83,7 @@ mod tests { [nats] format = \"[$symbol$name](bold red)\" symbol = \"N \" + disabled = false " )) .unwrap(),