find_command

Function find_command 

Source
pub fn find_command(name: &str) -> Option<PathBuf>
Expand description

Try to find an executable named name.

  • If name contains 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)

Returns Some(PathBuf) of the first found executable, or None.