mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-09-28 21:19:10 +00:00
82c7fd6742
This makes it possible to configure when the terraform module is shown based on the contents of a directory. This should make it possible to be a lot more granular when configuring the module.
29 lines
784 B
Rust
29 lines
784 B
Rust
use crate::config::{ModuleConfig, RootModuleConfig};
|
|
|
|
use starship_module_config_derive::ModuleConfig;
|
|
|
|
#[derive(Clone, ModuleConfig)]
|
|
pub struct TerraformConfig<'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>,
|
|
}
|
|
|
|
impl<'a> RootModuleConfig<'a> for TerraformConfig<'a> {
|
|
fn new() -> Self {
|
|
TerraformConfig {
|
|
format: "via [$symbol$workspace]($style) ",
|
|
symbol: "💠 ",
|
|
style: "bold 105",
|
|
disabled: false,
|
|
detect_extensions: vec!["tf", "hcl"],
|
|
detect_files: vec![],
|
|
detect_folders: vec![".terraform"],
|
|
}
|
|
}
|
|
}
|