mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
fix: correct detect install method when running from a subtree
This commit is contained in:
parent
eb40402420
commit
05c01af68c
2 changed files with 16 additions and 4 deletions
|
|
@ -322,7 +322,7 @@ def check_for_updates() -> Optional[int]:
|
|||
# (branding.tsx, guarded on `typeof === 'number' && > 0`) show nothing.
|
||||
try:
|
||||
from hermes_cli.config import detect_install_method, get_project_root
|
||||
if detect_install_method() == "docker":
|
||||
if detect_install_method(get_project_root()) == "docker":
|
||||
return None
|
||||
except Exception:
|
||||
pass
|
||||
|
|
@ -885,7 +885,7 @@ def build_welcome_banner(console: "Console", model: str, cwd: str,
|
|||
is_unsupported_install_method,
|
||||
get_project_root
|
||||
)
|
||||
_install_method = detect_install_method()
|
||||
_install_method = detect_install_method(get_project_root())
|
||||
if is_unsupported_install_method(_install_method):
|
||||
right_lines.append(
|
||||
f"[bold yellow]⚠ {format_unsupported_install_warning(_install_method)}[/]"
|
||||
|
|
|
|||
|
|
@ -439,8 +439,20 @@ def detect_install_method(project_root: Optional[Path] = None) -> str:
|
|||
managed = get_managed_system()
|
||||
if managed:
|
||||
return managed.lower().replace(" ", "-")
|
||||
if (root / ".git").is_dir():
|
||||
|
||||
# detect git repo installs (normal installer, development env)
|
||||
git_path = root / ".git"
|
||||
if git_path.is_dir():
|
||||
return "git"
|
||||
|
||||
# detect git repo installs from worktrees
|
||||
if git_path.is_file():
|
||||
try:
|
||||
content = git_path.read_text(encoding="utf-8").strip()
|
||||
if content.startswith("gitdir:"):
|
||||
return "git"
|
||||
except OSError:
|
||||
pass
|
||||
return "pip"
|
||||
|
||||
|
||||
|
|
@ -526,7 +538,7 @@ def recommended_update_command() -> str:
|
|||
managed_cmd = get_managed_update_command()
|
||||
if managed_cmd:
|
||||
return managed_cmd
|
||||
method = detect_install_method()
|
||||
method = detect_install_method(get_project_root())
|
||||
return recommended_update_command_for_method(method)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue