MCPcopy Create free account
hub / github.com/cocoindex-io/cocoindex-code / resolve_default_path

Function resolve_default_path

src/cocoindex_code/cli.py:126–135  ·  view source on GitHub ↗

Compute default ``--path`` filter from CWD relative to project root.

(project_root: Path)

Source from the content-addressed store, hash-verified

124
125
126def resolve_default_path(project_root: Path) -> str | None:
127 """Compute default ``--path`` filter from CWD relative to project root."""
128 cwd = Path.cwd().resolve()
129 try:
130 rel = cwd.relative_to(project_root)
131 except ValueError:
132 return None
133 if rel == Path("."):
134 return None
135 return f"{rel.as_posix()}/*"
136
137
138def _format_progress(progress: IndexingProgress) -> str:

Calls

no outgoing calls