#[derive(Debug, Default, serde::Deserialize)] pub struct TciConfig { #[serde(default)] pub allow_all: bool, #[serde(default)] pub branch: Option, #[serde(default)] pub hooks: Vec, #[serde(default)] pub setup: Vec, #[serde(default)] pub cleanup: Vec, } impl TciConfig { pub fn load() -> Result { let config_path = std::env::var("TCI_CONFIG") .as_deref() .unwrap_or("/etc/tci/config.toml"); let cfg_raw = std::fs::read_to_string(config_path) .unwrap_or_default(); toml::from_str(&cfg_raw) } } #[derive(Debug, Default, serde::Deserialize)] pub struct TciScriptConfig { #[serde(default)] pub branch: Option, #[serde(default)] pub filter: Option, #[serde(default)] pub scripts: Vec, // #[serde(default)] // concurrent: bool, } impl TciScriptConfig { pub fn load(path: &std::path::PathBuf) -> Result { let cfg_raw = std::fs::read_to_string(path) .unwrap_or_default(); toml::from_str(&cfg_raw) } }