git-override 0.1.0

Enable overriding git subcommands
Documentation
use is_executable::IsExecutable;
use std::path::{Path, PathBuf};

/// Find the absolute path for an executable on PATH
pub fn scan_path<S>(exename: S) -> anyhow::Result<Vec<PathBuf>>
where
    S: AsRef<Path>,
{
    let mut found = vec![];

    for dir in std::env::var("PATH")?.split(':') {
        let dir: &Path = dir.as_ref();
        let candidate = dir.join(exename.as_ref());
        if candidate.is_executable() {
            found.push(candidate.canonicalize()?);
        }
    }

    Ok(found)
}