mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-23 05:31:23 +00:00
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:
parent
96917fb74a
commit
55a7c45d37
1 changed files with 13 additions and 0 deletions
|
|
@ -7396,6 +7396,19 @@ def _cmd_update_check():
|
||||||
"""Implement ``hermes update --check``: fetch and report without installing."""
|
"""Implement ``hermes update --check``: fetch and report without installing."""
|
||||||
git_dir = PROJECT_ROOT / ".git"
|
git_dir = PROJECT_ROOT / ".git"
|
||||||
if not git_dir.exists():
|
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.")
|
print("✗ Not a git repository — cannot check for updates.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue