woofind 0.1.0

Blazing-fast Go import discovery with lock-free concurrency and fuzzy matching
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Clear command - Clear the cache

use anyhow::Result;

use crate::cache::MmapCache;
use crate::cli::print_success;

pub async fn run() -> Result<()> {
    let cache_dir = dirs::cache_dir()
        .map(|d| d.join("woofind"))
        .unwrap_or_else(|| std::path::PathBuf::from(".woofind_cache"));

    let cache = MmapCache::new(&cache_dir)?;
    cache.clear()?;

    print_success("Cache cleared successfully");
    Ok(())
}