mirror of
https://github.com/starship/starship.git
synced 2026-06-24 02:01:36 +07:00
d0951db35a
* feat(dart): Configure when the module is shown This makes it possible to configure when the dart 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. * docs(dart): add missing detected files * removed invalid comment
29 lines
810 B
Rust
29 lines
810 B
Rust
use crate::config::{ModuleConfig, RootModuleConfig};
|
|
|
|
use starship_module_config_derive::ModuleConfig;
|
|
|
|
#[derive(Clone, ModuleConfig)]
|
|
pub struct DartConfig<'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 DartConfig<'a> {
|
|
fn new() -> Self {
|
|
DartConfig {
|
|
format: "via [$symbol($version )]($style)",
|
|
symbol: "🎯 ",
|
|
style: "bold blue",
|
|
disabled: false,
|
|
detect_extensions: vec!["dart"],
|
|
detect_files: vec!["pubspec.yaml", "pubspec.yml", "pubspec.lock"],
|
|
detect_folders: vec![".dart_tool"],
|
|
}
|
|
}
|
|
}
|