pub fn find_command(name: &str) -> Option<PathBuf>Expand description
Try to find an executable named name.
- If
namecontains a path separator, that path is checked directly. - Otherwise the function searches:
- directories from
PATH - some common system directories (
/usr/bin,/usr/local/bin,/bin, …) - NixOS-specific locations (
/run/current-system/sw/bin,$HOME/.nix-profile/bin,/nix/var/nix/profiles/default/bin)
- directories from
Returns Some(PathBuf) of the first found executable, or None.