2021-03-15 10:40:52 +00:00
|
|
|
use crate::config::ModuleConfig;
|
2021-02-20 14:38:03 +00:00
|
|
|
|
2021-03-31 15:31:55 +00:00
|
|
|
use serde::Serialize;
|
2021-02-20 14:38:03 +00:00
|
|
|
use starship_module_config_derive::ModuleConfig;
|
|
|
|
|
2021-03-31 15:31:55 +00:00
|
|
|
#[derive(Clone, ModuleConfig, Serialize)]
|
2021-02-20 14:38:03 +00:00
|
|
|
pub struct DotnetConfig<'a> {
|
|
|
|
pub format: &'a str,
|
2021-04-29 21:22:20 +00:00
|
|
|
pub version_format: &'a str,
|
2021-02-20 14:38:03 +00:00
|
|
|
pub symbol: &'a str,
|
|
|
|
pub style: &'a str,
|
|
|
|
pub heuristic: bool,
|
|
|
|
pub disabled: bool,
|
|
|
|
pub detect_extensions: Vec<&'a str>,
|
|
|
|
pub detect_files: Vec<&'a str>,
|
|
|
|
pub detect_folders: Vec<&'a str>,
|
|
|
|
}
|
|
|
|
|
2021-03-15 10:40:52 +00:00
|
|
|
impl<'a> Default for DotnetConfig<'a> {
|
|
|
|
fn default() -> Self {
|
2021-02-20 14:38:03 +00:00
|
|
|
DotnetConfig {
|
|
|
|
format: "[$symbol($version )(🎯 $tfm )]($style)",
|
2021-04-29 21:22:20 +00:00
|
|
|
version_format: "v${raw}",
|
2021-03-18 17:46:54 +00:00
|
|
|
symbol: ".NET ",
|
2021-02-20 14:38:03 +00:00
|
|
|
style: "blue bold",
|
|
|
|
heuristic: true,
|
|
|
|
disabled: false,
|
|
|
|
detect_extensions: vec!["sln", "csproj", "fsproj", "xproj"],
|
|
|
|
detect_files: vec![
|
|
|
|
"global.json",
|
|
|
|
"project.json",
|
|
|
|
"Directory.Build.props",
|
|
|
|
"Directory.Build.targets",
|
|
|
|
"Packages.props",
|
|
|
|
],
|
|
|
|
detect_folders: vec![],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|