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

@ -41,15 +41,15 @@ _DEP_DESCRIPTIONS = {
def _has_system_browser() -> bool:
for name in ("google-chrome", "google-chrome-stable", "chromium", "chromium-browser"):
for name in ("google-chrome", "google-chrome-stable", "chromium", "chromium-browser", "chrome"):
if shutil.which(name):
return True
return False
def _has_hermes_agent_browser() -> bool:
hermes_home = os.environ.get("HERMES_HOME", str(Path.home() / ".hermes"))
return (Path(hermes_home) / "node_modules" / ".bin" / "agent-browser").is_file()
from hermes_constants import get_hermes_home
return (get_hermes_home() / "node_modules" / ".bin" / "agent-browser").is_file()
def _find_install_script(