Split health->general, added runtime missing warnings to hx --help <language>

pull/13814/head
ktoks 2025-06-21 13:32:50 -06:00
parent f4b488e380
commit 336a2f69e6
1 changed files with 19 additions and 1 deletions

View File

@ -83,6 +83,19 @@ pub fn general() -> std::io::Result<()> {
);
writeln!(stdout, "{}", msg.yellow())?;
}
}
Ok(())
}
/// Display warnings if runtime directories don't exist.
pub fn runtime_warnings() -> std::io::Result<()> {
let stdout = std::io::stdout();
let mut stdout = stdout.lock();
let rt_dirs = helix_loader::runtime_dirs();
for rt_dir in rt_dirs.iter() {
if !rt_dir.exists() {
let msg = format!("Runtime directory does not exist: {}", rt_dir.display());
writeln!(stdout, "{}", msg.yellow())?;
@ -395,11 +408,16 @@ pub fn print_health(health_arg: Option<String>) -> std::io::Result<()> {
Some("clipboard") => clipboard()?,
None | Some("all") => {
general()?;
runtime_warnings()?;
clipboard()?;
writeln!(std::io::stdout().lock())?;
languages_all()?;
}
Some(lang) => language(lang.to_string())?,
Some(lang) => {
language(lang.to_string())?;
writeln!(std::io::stdout().lock())?;
runtime_warnings()?;
}
}
Ok(())
}