| 239 | } |
| 240 | |
| 241 | pub fn resolve_layout(project_root: &Path, profile_root: &Path) -> Result<StoreLayout> { |
| 242 | match read_enrollment_marker(project_root)? { |
| 243 | Some(marker) if marker.storage_mode == StorageMode::ProfileSharded => { |
| 244 | profile_sharded_layout(project_root, profile_root, &marker) |
| 245 | } |
| 246 | Some(marker) => Err(TraceDecayError::Config { |
| 247 | message: format!( |
| 248 | "unsupported storage_mode={:?} in enrollment marker for '{}'; \ |
| 249 | run TraceDecay migration to move this project into the user profile store", |
| 250 | marker.storage_mode, |
| 251 | project_root.display() |
| 252 | ), |
| 253 | }), |
| 254 | None => default_profile_sharded_layout(project_root, profile_root), |
| 255 | } |
| 256 | } |
| 257 | |
| 258 | pub fn default_profile_root() -> Result<PathBuf> { |
| 259 | config::user_data_dir().ok_or_else(|| TraceDecayError::Config { |