Skip to main content

discover_project_savecontext_dir

Function discover_project_savecontext_dir 

Source
pub fn discover_project_savecontext_dir() -> Option<PathBuf>
Expand description

Discover the project-level SaveContext directory for JSONL exports.

Walks up from the current directory looking for .savecontext/. This is used for finding the per-project export directory, NOT the database.

§Returns

Returns the path to the project .savecontext/ directory, or None if not found.

Resolution strategy:

  1. Check the git root first — if the git root has .savecontext/, use it. This prevents subdirectory export dirs from shadowing the real project root.
  2. Fall back to walking up from CWD (for non-git projects).