nu_path::expansions

Function locate_in_dirs

Source
pub fn locate_in_dirs<I, P>(
    filename: impl AsRef<Path>,
    cwd: impl AsRef<Path>,
    dirs: impl FnOnce() -> I,
) -> Result<PathBuf>
where I: IntoIterator<Item = P>, P: AsRef<Path>,
Expand description

Attempts to canonicalize the path against the current directory. Failing that, if the path is relative, it attempts all of the dirs in dirs. If that fails, it returns the original error.