use crate::AppConfig;

impl AppConfig {
    pub fn avatar_path(&self) -> anyhow::Result<String> {
        if let Some(url) = self.env.get("APP_AVATAR_PATH") {
            return Ok(url.to_string());
        }
        Err(anyhow::anyhow!("APP_AVATAR_PATH not found"))
    }

    pub fn repos_root(&self) -> anyhow::Result<String> {
        if let Some(root) = self.env.get("APP_REPOS_ROOT") {
            return Ok(root.to_string());
        }
        Ok("/data/repos".to_string())
    }
}
