mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-10 03:30:59 +00:00
Add spinner to arc doctor for immediate feedback
The command takes several seconds (especially with live probes) but previously showed no output until fully complete. Now a braille spinner animates while checks run. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
0af7a32794
commit
83ed0d42a4
2 changed files with 12 additions and 0 deletions
|
|
@ -26,6 +26,7 @@ arc-api = { path = "../arc-api", optional = true }
|
|||
arc-util = { path = "../arc-util" }
|
||||
clap.workspace = true
|
||||
console.workspace = true
|
||||
indicatif.workspace = true
|
||||
daytona-sdk.workspace = true
|
||||
anyhow.workspace = true
|
||||
dotenvy.workspace = true
|
||||
|
|
|
|||
|
|
@ -921,6 +921,15 @@ async fn probe_url(http: &reqwest::Client, url: &str) -> Result<(), String> {
|
|||
pub async fn run_doctor(verbose: bool, live: bool) -> i32 {
|
||||
let styles = Styles::detect_stdout();
|
||||
|
||||
let spinner = indicatif::ProgressBar::new_spinner();
|
||||
spinner.set_style(
|
||||
indicatif::ProgressStyle::with_template("{spinner:.cyan} {msg}")
|
||||
.expect("valid template")
|
||||
.tick_strings(&["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏", ""]),
|
||||
);
|
||||
spinner.set_message("Running checks…");
|
||||
spinner.enable_steady_tick(std::time::Duration::from_millis(80));
|
||||
|
||||
// Gather state
|
||||
let cli_config = arc_config::cli::load_cli_config(None).unwrap_or_default();
|
||||
|
||||
|
|
@ -1128,6 +1137,8 @@ pub async fn run_doctor(verbose: bool, live: bool) -> i32 {
|
|||
checks,
|
||||
};
|
||||
|
||||
spinner.finish_and_clear();
|
||||
|
||||
let term_width = console::Term::stderr().size().1;
|
||||
print!(
|
||||
"{}",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue