2022-07-20 13:41:42 +00:00
|
|
|
import shutil
|
|
|
|
from pathlib import Path
|
2023-11-08 19:01:23 +00:00
|
|
|
from typing import Optional
|
2022-12-26 22:35:23 +00:00
|
|
|
|
2022-07-20 13:41:42 +00:00
|
|
|
|
|
|
|
def get_binary_path(*names: str) -> Optional[Path]:
|
|
|
|
"""Get the path of the first found binary name."""
|
|
|
|
for name in names:
|
|
|
|
path = shutil.which(name)
|
|
|
|
if path:
|
|
|
|
return Path(path)
|
|
|
|
return None
|