(path: AnyStr, exe: Optional[AnyStr] = None)
| 48 | |
| 49 | @functools.lru_cache() |
| 50 | def find_executable(path: AnyStr, exe: Optional[AnyStr] = None) -> AnyStr: |
| 51 | if exe is None: |
| 52 | if is_executable(path): |
| 53 | return path |
| 54 | else: |
| 55 | raise FileNotFoundError(path) |
| 56 | find_pattern = f"{path}/**/{exe}" |
| 57 | for name in glob.iglob(find_pattern, recursive=True): |
| 58 | if is_executable(name): |
| 59 | return name |
| 60 | raise FileNotFoundError(f"{exe} not found in {path}") |
| 61 | |
| 62 | |
| 63 | def download_file(url: AnyStr, name: AnyStr, download_if_exists: bool = True): |
no test coverage detected