From fb9d2f4f515b5818bc70655a85bb413edd8d36c9 Mon Sep 17 00:00:00 2001 From: ripytide Date: Sun, 10 Nov 2024 22:42:19 +0000 Subject: [PATCH] fix: fixed command finding not working on windows --- src/cmd.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/cmd.rs b/src/cmd.rs index 2e7cb2e..7f416bf 100644 --- a/src/cmd.rs +++ b/src/cmd.rs @@ -4,15 +4,7 @@ use color_eyre::{eyre::eyre, Result}; use itertools::Itertools; pub fn command_found(command: &str) -> bool { - if let Ok(path) = std::env::var("PATH") { - for p in path.split(':') { - let p_str = format!("{}/{}", p, command); - if std::fs::metadata(p_str).is_ok() { - return true; - } - } - } - false + which::which(command).is_ok() } #[derive(Debug, Clone, Copy)]