Skip to main content

find_version_file

Function find_version_file 

Source
pub fn find_version_file(start_dir: &Path) -> Option<NodeRequest>
Expand description

Walk upward from start_dir looking for .node-version then .nvmrc (same-directory precedence: .node-version wins; nearer directory beats farther). The walk stops after checking the home directory (inclusive) or the filesystem root, whichever comes first — predictable, and matches what nvm/fnm users expect in monorepos where the version file sits above the invocation dir.

A file that exists but doesn’t parse as a version request is logged and treated as absent rather than failing the command — a stray .nvmrc containing prose shouldn’t break aubr test.