Skip to main content

find_program

Function find_program 

Source
pub fn find_program(path: &OsStr) -> Option<PathBuf>
Expand description

What: The first executable file named git-lfs in the directories of a PATH value, in order. Why: A stat per directory answers it without starting any process; an empty entry means the current directory, as PATH lookup treats it. The upload starts exactly this file, so the pre-check and the start agree about which git-lfs runs even though the child’s PATH leads with the real Git’s directory.

In TS you’d write (pseudocode):

path.split(':').map((dir) => join(dir || '.', 'git-lfs')).find(isExecutableFile)