pub mod git_status_cache;
pub mod repository_cache;
pub use git_status_cache::GitStatusCache;
pub use repository_cache::RepositoryCache;
use anyhow::Result;
use std::path::Path;
#[allow(dead_code)]
pub async fn initialize_cache<P: AsRef<Path>>(cache_dir: P) -> Result<()> {
let cache_dir = cache_dir.as_ref();
if !cache_dir.exists() {
tokio::fs::create_dir_all(cache_dir).await?;
}
let repo_cache = RepositoryCache::new(cache_dir.join("repositories.db"));
repo_cache.initialize().await?;
let git_cache = GitStatusCache::new(cache_dir.join("git_status.db"));
git_cache.initialize().await?;
Ok(())
}