Function nu_parser::find_in_dirs

source ·
pub fn find_in_dirs(
    filename: &str,
    working_set: &StateWorkingSet<'_>,
    cwd: &str,
    dirs_env: &str
) -> Option<PathBuf>
Expand description

This helper function is used to find files during parsing

First, the actual current working directory is selected as a) the directory of a file currently being parsed b) current working directory (PWD)

Then, if the file is not found in the actual cwd, NU_LIB_DIRS is checked. If there is a relative path in NU_LIB_DIRS, it is assumed to be relative to the actual cwd determined in the first step.

Always returns an absolute path