refactor: DRY cleanup from code review

- dep_ensure.py: use get_hermes_home() instead of hand-rolled env var
- dep_ensure.py: add "chrome" to browser name list (was inconsistent with browser_tool.py)
- main.py _cmd_update_check: use detect_install_method() directly instead of redundant .git check
- main.py _cmd_update_pip: build command list directly instead of fragile split() on display string
- banner.py: rename _check_via_pypi → check_via_pypi (cross-module public API)
This commit is contained in:
alt-glitch 2026-05-15 13:47:43 +00:00 committed by Teknium
parent 164a77dec9
commit 47c0efe1c0
5 changed files with 39 additions and 36 deletions

View file

@ -199,7 +199,7 @@ def _fetch_pypi_latest(package: str = "hermes-agent") -> Optional[str]:
return None
def _check_via_pypi() -> Optional[int]:
def check_via_pypi() -> Optional[int]:
"""Compare installed version against PyPI latest.
Returns 0 if up-to-date, 1 if behind, None on failure.
@ -255,7 +255,7 @@ def check_for_updates() -> Optional[int]:
if not (repo_dir / ".git").exists():
repo_dir = hermes_home / "hermes-agent"
if not (repo_dir / ".git").exists():
behind = _check_via_pypi()
behind = check_via_pypi()
else:
behind = _check_via_local_git(repo_dir)