use super::*;
pub(super) async fn refresh(home: &Path, installation: &Installation) {
match install::inspect(&installation.binary).await {
Ok(installed) if installed == build_info::current() => {}
_ => return,
}
let home = home.to_owned();
let result =
tokio::task::spawn_blocking(move || crate::integration::refresh::refresh(&home)).await;
match result {
Ok(Ok(report)) if report["blocked"] == 0 => {}
Ok(Ok(_)) => eprintln!(
"Gent integration refresh needs attention; inspect gent integration refresh --json."
),
Ok(Err(error)) => eprintln!("Gent integration refresh pending: {error}"),
Err(_) => eprintln!("Gent integration refresh task failed; the next check will retry."),
}
}