From 6d724a8f331f4b2a8f1a001e990cf6129dc50b00 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 23 Jan 2024 09:29:07 -0500 Subject: Re-export `which` from `helix-stdx::env` We use `which::which` in many crates, so `which` was a separate dependency across all of them. We can centralize `which` into the stdx crate so it's easy for all crates to depend on it. I also moved the rest of `helix-view/src/env.rs` into helix-stdx's `env` module since it only contained a thin wrapper around `which` and `std::env`. --- helix-term/src/health.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'helix-term/src') diff --git a/helix-term/src/health.rs b/helix-term/src/health.rs index 44ae2a2f..5f201926 100644 --- a/helix-term/src/health.rs +++ b/helix-term/src/health.rs @@ -182,7 +182,7 @@ pub fn languages_all() -> std::io::Result<()> { .sort_unstable_by_key(|l| l.language_id.clone()); let check_binary = |cmd: Option<&str>| match cmd { - Some(cmd) => match which::which(cmd) { + Some(cmd) => match helix_stdx::env::which(cmd) { Ok(_) => column(&format!("✓ {}", cmd), Color::Green), Err(_) => column(&format!("✘ {}", cmd), Color::Red), }, @@ -322,7 +322,7 @@ fn probe_protocols<'a, I: Iterator + 'a>( writeln!(stdout)?; for cmd in server_cmds { - let (path, icon) = match which::which(cmd) { + let (path, icon) = match helix_stdx::env::which(cmd) { Ok(path) => (path.display().to_string().green(), "✓".green()), Err(_) => (format!("'{}' not found in $PATH", cmd).red(), "✘".red()), }; @@ -344,7 +344,7 @@ fn probe_protocol(protocol_name: &str, server_cmd: Option) -> std::io::R writeln!(stdout, "Configured {}: {}", protocol_name, cmd_name)?; if let Some(cmd) = server_cmd { - let path = match which::which(&cmd) { + let path = match helix_stdx::env::which(&cmd) { Ok(path) => path.display().to_string().green(), Err(_) => format!("'{}' not found in $PATH", cmd).red(), }; -- cgit v1.2.3-70-g09d2