Skip to content

Commit

Permalink
fix: fixed command finding not working on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ripytide committed Nov 10, 2024
1 parent be8d8d2 commit fb9d2f4
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit fb9d2f4

Please sign in to comment.