summaryrefslogtreecommitdiff
path: root/helix-term/src/health.rs
diff options
context:
space:
mode:
authorMichael Davis2024-01-23 14:29:07 +0000
committerBlaž Hrastnik2024-01-24 06:47:49 +0000
commit6d724a8f331f4b2a8f1a001e990cf6129dc50b00 (patch)
treecc2d8c6068ec8ad58aa29320c08c6218b2e8070d /helix-term/src/health.rs
parent6bfe1ddc53f542d62e242fd4aaf6748dda1b0e71 (diff)
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`.
Diffstat (limited to 'helix-term/src/health.rs')
-rw-r--r--helix-term/src/health.rs6
1 files changed, 3 insertions, 3 deletions
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<Item = &'a str> + '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<String>) -> 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(),
};