INNER CODE UNIT · Python

get_repo_root

yohey-w/multi-agent-shogun · scripts/dashboard-viewer.py:207

def get_repo_root() -> Path:
    """Resolve the git repository root."""
    try:
        result = subprocess.run(
            ["git", "rev-parse", "--show-toplevel"],
            capture_output=True,
            text=True,
            check=True,
        )
        return Path(result.stdout.strip())
    except subprocess.CalledProcessError:
        # Fall back to the directory containing this script's parent
        return Path(__file__).resolve().parent.parent


class DashboardHandler(http.server.BaseHTTPRequestHandler):
    dashboard_path: Path  # set before server starts

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…