use std::path::PathBuf; use anyhow::Context; use serde::Deserialize; pub fn read_config(path: &PathBuf) -> anyhow::Result { let toml = std::fs::read(path) .with_context(|| format!("Failed to read config file at {:#?}", path))?; let config = toml::from_slice(&toml) .with_context(|| format!("Failed to parse config file at {:#?}", path))?; Ok(config) } #[derive(Debug, Default, Deserialize)] pub struct Config { pub repositories: Vec, } #[derive(Debug, Deserialize)] pub struct RepoConfig { pub remote_git_repo: String, pub local_git_repo: String, pub remote_package_repo: String, }