find_in_path multimethod

Methods

find_in_path(executable_name:Str) Source: stdlib.ngs:5281
Finds given binary and returns it's full path. Throws ProgramNotFound if the binary was not found. Search strategy: "/" in the name of the binary means that given executable_name is a path so it's returned as-is (wrapped in Path). If PATH environment variable exists, the given directories are searched. If PATH is not set built-in value for PATH is used to search: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Returns

Path

Example

find_in_path("ls")  # <Path path=/bin/ls>