Skip to content

Commit

Permalink
set disabled to true
Browse files Browse the repository at this point in the history
  • Loading branch information
hooksie1 committed Mar 31, 2024
1 parent 766bfc5 commit 7c91b87
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/config-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1024,8 +1024,8 @@
},
"nats": {
"default": {
"disabled": false,
"format": "$name($style)",
"disabled": true,
"format": "[$symbol$name]($style)",
"style": "bold purple",
"symbol": ""
},
Expand Down Expand Up @@ -4384,7 +4384,7 @@
"type": "object",
"properties": {
"format": {
"default": "$name($style)",
"default": "[$symbol$name]($style)",
"type": "string"
},
"symbol": {
Expand All @@ -4396,7 +4396,7 @@
"type": "string"
},
"disabled": {
"default": false,
"default": true,
"type": "boolean"
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/configs/nats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl<'a> Default for NatsConfig<'a> {
format: "[$symbol$name]($style)",
symbol: "",
style: "bold purple",
disabled: false,
disabled: true,
}
}
}
2 changes: 1 addition & 1 deletion src/configs/starship_root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pub const PROMPT_ORDER: &[&str] = &[
"shlvl",
"singularity",
"kubernetes",
"nats",
"directory",
"vcsh",
"fossil_branch",
Expand Down Expand Up @@ -74,7 +75,6 @@ pub const PROMPT_ORDER: &[&str] = &[
"kotlin",
"lua",
"nim",
"nats",
"nodejs",
"ocaml",
"opa",
Expand Down
6 changes: 6 additions & 0 deletions src/modules/nats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
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;
Expand Down Expand Up @@ -59,6 +63,7 @@ mod tests {
[nats]
format = \"[$symbol$name](bold purple)\"
symbol = \"\"
disabled = false
"
))
.unwrap(),
Expand All @@ -78,6 +83,7 @@ mod tests {
[nats]
format = \"[$symbol$name](bold red)\"
symbol = \"N \"
disabled = false
"
))
.unwrap(),
Expand Down

0 comments on commit 7c91b87

Please sign in to comment.