devist 0.2.0

Project bootstrap CLI for AI-assisted development. Spin up new projects from templates, manage backends, and keep your codebase comprehensible.
use anyhow::{Context, Result};
use std::path::PathBuf;

pub fn home() -> Result<PathBuf> {
    dirs::home_dir().context("Could not determine home directory")
}

pub fn devist_root() -> Result<PathBuf> {
    Ok(home()?.join(".devist"))
}

pub fn config_file() -> Result<PathBuf> {
    Ok(devist_root()?.join("config.toml"))
}

pub fn registry_file() -> Result<PathBuf> {
    Ok(devist_root()?.join("registry.toml"))
}

pub fn templates_dir() -> Result<PathBuf> {
    Ok(devist_root()?.join("templates"))
}

#[allow(dead_code)]
pub fn cache_dir() -> Result<PathBuf> {
    Ok(devist_root()?.join("cache"))
}