ichwh
- an async implementation of GNU which
NOTE: this crate is in early development. Only Linux is currently supported.
ichwh
aims to be a fully-async clone of GNU which
, compatible with the three major operating systems. The main job of which
is to search for executables on the current PATH
.
This crate is similar to the synchronous which
crate.
In Cargo.toml
:
toml
ichwh = "*"
In your source files:
```rust use ichwh::which;
let pathtopython = which("python").await.unwrap(); asserteq!(pathtopython.tostr().unwrap(), "/usr/bin/python"); ```
Run tests with cargo test
. The tests will create a set of temporary test folders. On unix systems, they are rooted at /tmp/ichwh-test-<num>
, where <num>
is the number of minutes since the epoch. If all tests pass, the folders will be cleaned up. Any failing tests will preserve their test folders for inspection and debugging.
See CONTRIBUTING.md.