a786ca3391
test / run tests/run_tests.py (pull_request) Successful in 14s
New file claude_bottle/backend/util.py for cross-backend host-side
helpers:
host_skill_dir(name) — resolves $HOME/.claude/skills/<name>
docker/util.py gains:
docker_exec_root(container, argv) — `docker exec -u 0` wrapper used
by SSH provisioning
DockerBottleBackend drops the two methods that wrapped these
(`_host_skill_dir`, `_docker_exec_root`) — they had no instance state
and just lived on the class for organizational reasons. Call sites
now use the imported functions directly.
19 lines
538 B
Python
19 lines
538 B
Python
"""Cross-backend utility helpers — host-side primitives shared by
|
|
every backend implementation. Backend-specific helpers live one level
|
|
deeper (e.g. claude_bottle/backend/docker/util.py)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
|
|
from ..log import die
|
|
|
|
|
|
def host_skill_dir(name: str) -> str:
|
|
"""Return the host-side path for a named skill:
|
|
`$HOME/.claude/skills/<name>`. Dies if HOME is unset."""
|
|
home = os.environ.get("HOME")
|
|
if not home:
|
|
die("HOME not set")
|
|
return f"{home}/.claude/skills/{name}"
|