| 139 | } |
| 140 | |
| 141 | pub fn write_enrollment_marker(project_root: &Path, marker: &EnrollmentMarker) -> Result<()> { |
| 142 | validate_enrollment_marker(marker, &enrollment_marker_path(project_root))?; |
| 143 | let path = enrollment_marker_path(project_root); |
| 144 | let text = serde_json::to_vec_pretty(marker).map_err(|e| TraceDecayError::Config { |
| 145 | message: format!( |
| 146 | "failed to serialize enrollment marker '{}': {e}", |
| 147 | path.display() |
| 148 | ), |
| 149 | })?; |
| 150 | PrivateStoreIo::write_file(&path, &text).map_err(|e| TraceDecayError::Config { |
| 151 | message: format!( |
| 152 | "failed to write enrollment marker '{}': {e}", |
| 153 | path.display() |
| 154 | ), |
| 155 | }) |
| 156 | } |
| 157 | |
| 158 | pub fn remove_enrollment_marker(project_root: &Path, project_id: &str) -> Result<bool> { |
| 159 | let path = enrollment_marker_path(project_root); |