def find_ancestor_cmd_path(self, cmd, cwd):

        node_modules_bin = path.normpath(path.join(cwd, 'node_modules/.bin/'))

        binary = path.join(node_modules_bin, cmd)

        if sublime.platform() == 'windows' and path.splitext(binary)[1] != '.cmd':
            binary += '.cmd'

        if binary and access(binary, X_OK):
            return binary

        parent = path.normpath(path.join(cwd, '../'))

        if parent == '/' or parent == cwd:
            return None

        return self.find_ancestor_cmd_path(cmd, parent)
Recursively check for command binary in ancestors' node_modules/.bin directories.
dataset/ETHPy150Open SublimeLinter/SublimeLinter3/lint/node_linter.py/NodeLinter.find_ancestor_cmd_path