fix(update): handle --check for pip installs (missed code path)

_cmd_update_check() had its own `.git` gate separate from _cmd_update_impl.
For pip installs, fork to _check_via_pypi() and display the result with
the correct recommended_update_command().
This commit is contained in:
alt-glitch 2026-05-15 13:01:37 +00:00 committed by Teknium
parent 96917fb74a
commit 55a7c45d37

View file

@ -7396,6 +7396,19 @@ def _cmd_update_check():
"""Implement ``hermes update --check``: fetch and report without installing."""
git_dir = PROJECT_ROOT / ".git"
if not git_dir.exists():
from hermes_cli.config import detect_install_method, recommended_update_command
if detect_install_method(PROJECT_ROOT) == "pip":
from hermes_cli.banner import _check_via_pypi
result = _check_via_pypi()
if result is None:
print("✗ Could not reach PyPI to check for updates.")
sys.exit(1)
elif result == 0:
print("✓ Already up to date.")
else:
print(f"⚕ Update available on PyPI.")
print(f" Run '{recommended_update_command()}' to install.")
return
print("✗ Not a git repository — cannot check for updates.")
sys.exit(1)