Skip to content

Commit

Permalink
add: /usr/local/bin and /usr/local/sbin to which()
Browse files Browse the repository at this point in the history
  • Loading branch information
grtcdr committed Mar 9, 2021
1 parent b6646b1 commit c3ea019
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "macchina"
version = "0.5.2"
version = "0.5.3"
authors = ["grtcdr <ba.tahaaziz@gmail.com>"]
edition = "2018"
description = "System information fetcher"
Expand Down
4 changes: 4 additions & 0 deletions src/extra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ pub fn which(program_name: &str) -> bool {
true
} else if Path::new(&String::from("/usr/pkg/bin/".to_owned() + &program_name)).exists() {
true
} else if Path::new(&String::from("/usr/local/bin/".to_owned() + &program_name)).exists() {
true
} else if Path::new(&String::from("/usr/local/sbin/".to_owned() + &program_name)).exists() {
true
} else {
false
}
Expand Down

0 comments on commit c3ea019

Please sign in to comment.