mirror of
https://github.com/starship/starship.git
synced 2026-06-22 02:02:12 +07:00
cec111affd
* update AllowStatus to work with direnv 2.33 direnv now returns int enum instead of boolean, https://github.com/direnv/direnv/pull/1158 * update schema * maybe fixed the schema now * Whoops, I inverted the flags somehow * have coffee, fix mistaken understanding * undo changes to tranlations * Update docs/config/README.md * Update src/modules/direnv.rs Co-authored-by: David Knaack <davidkna@users.noreply.github.com> * update test output --------- Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
43 lines
1.1 KiB
Rust
Executable File
43 lines
1.1 KiB
Rust
Executable File
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Clone, Deserialize, Serialize)]
|
|
#[cfg_attr(
|
|
feature = "config-schema",
|
|
derive(schemars::JsonSchema),
|
|
schemars(deny_unknown_fields)
|
|
)]
|
|
#[serde(default)]
|
|
pub struct DirenvConfig<'a> {
|
|
pub format: &'a str,
|
|
pub symbol: &'a str,
|
|
pub style: &'a str,
|
|
pub disabled: bool,
|
|
pub detect_extensions: Vec<&'a str>,
|
|
pub detect_files: Vec<&'a str>,
|
|
pub detect_folders: Vec<&'a str>,
|
|
pub allowed_msg: &'a str,
|
|
pub not_allowed_msg: &'a str,
|
|
pub denied_msg: &'a str,
|
|
pub loaded_msg: &'a str,
|
|
pub unloaded_msg: &'a str,
|
|
}
|
|
|
|
impl<'a> Default for DirenvConfig<'a> {
|
|
fn default() -> Self {
|
|
Self {
|
|
format: "[$symbol$loaded/$allowed]($style) ",
|
|
symbol: "direnv ",
|
|
style: "bold orange",
|
|
disabled: true,
|
|
detect_extensions: vec![],
|
|
detect_files: vec![".envrc"],
|
|
detect_folders: vec![],
|
|
allowed_msg: "allowed",
|
|
not_allowed_msg: "not allowed",
|
|
denied_msg: "denied",
|
|
loaded_msg: "loaded",
|
|
unloaded_msg: "not loaded",
|
|
}
|
|
}
|
|
}
|