Represents a path finder that allows storing and retrieving options for finding an executable and methods to find the executable.
The path finder will use the options to look up by precendence:
- If the full path to the executable is provided, it will be used.
- If an environment variable is provided, it will be used.
- If a cached path is provided, it will be used.
- If the executable is found in the system path, it will be used.
- If the executable is found in the windows paths when on Windows, it will be used.
- If the executable is found in the darwin paths when on Darwin or linux paths, it will be used.
- If the executable is found in the linux paths, it will be used.
The paths for windows, darwin, and linux can contain environment variables e.g.
${USERPROFILE}, ${USER}, or `%USERPROFILE% that will be expanded before checking if the file exists.
clear(): void
Clears all path finders.
find(name: string): PathFinderOptions | undefined
Finds the path finder options for a given name.
findExeSync(name: string): string | undefined
Synchronously finds the executable path for a given name.
get(name: string): PathFinderOptions | undefined
Retrieves the path finder options for a given name.
set(name: string,options: PathFinderOptions,): void
Sets the path finder options for a given name.