|
def ensure_installed(tool: str, version: Optional[str] = None) -> str: |
|
"""Ensure a tool is installed, resolving its version if necessary.""" |
|
LOG.info("Ensuring %s is installed", tool) |
|
tool_path = _resolve_install(tool, version) |
|
if tool_path: |
|
LOG.info("%s available at %s", tool, tool_path) |
|
return tool |
|
LOG.warning("%s not found and could not be installed", tool) |
|
return tool |
It might have a chance to review and refactor ensure_installed to make it more straightforward
cpp-linter-hooks/cpp_linter_hooks/util.py
Lines 219 to 227 in 894947c
It might have a chance to review and refactor
ensure_installedto make it more straightforward