use std::path::Path;
use anyhow::Result;
use crate::pipeline;
pub fn run(repo: &Path) -> Result<()> {
let progress = crate::progress::Progress::stderr();
let report = pipeline::build_with(repo, None, &mut |phase| {
crate::progress::render(&progress, phase)
})?;
drop(progress);
pipeline::print_report(&report);
let repo = repo.canonicalize()?;
if report.scanned == 0 {
eprintln!(
"warning: 0 source files found under {} — wrong directory?",
repo.display()
);
}
println!(
" -> {} ({} on disk)",
pipeline::db_path(&repo).display(),
pipeline::db_size(&repo)
);
Ok(())
}