pub fn set(name: impl AsRef<str>, path: impl AsRef<Path>) -> Result<PathBuf>Available on crate feature
fs only.Expand description
Check and set bin name to the specified path. Return the absolute path that is set.
This is different from the other functions in the module, as it will overwrite the existing cache entry.
See cu::bin module-level documentation for more info.
ยงExample
use std::path::PathBuf;
assert_eq!(cu::which("ninja")?, PathBuf::from("/usr/bin/ninja"));
cu::bin::set("ninja", "/my/path/to/ninja")?;
// `which` now returns registered value
assert_eq!(cu::which("ninja")?, PathBuf::from("/my/path/to/ninja"));