MCPcopy Index your code
hub / github.com/github/spec-kit / _shared_relative_path

Function _shared_relative_path

src/specify_cli/shared_infra.py:150–160  ·  view source on GitHub ↗
(project_path: Path, dest: Path)

Source from the content-addressed store, hash-verified

148
149
150def _shared_relative_path(project_path: Path, dest: Path) -> Path:
151 try:
152 rel = dest.relative_to(project_path)
153 except ValueError:
154 label = _shared_destination_label(project_path, dest)
155 raise ValueError(f"Shared infrastructure path escapes project root: {label}") from None
156
157 if rel.is_absolute() or ".." in rel.parts:
158 label = _shared_destination_label(project_path, dest)
159 raise ValueError(f"Shared infrastructure path escapes project root: {label}")
160 return rel
161
162
163def _ensure_safe_shared_directory(

Calls 1

Tested by

no test coverage detected