MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / _cleanup_api_files

Function _cleanup_api_files

scripts/freeze_viewer.py:200–224  ·  view source on GitHub ↗

Remove API endpoint files that were created during freezing

(build_dir: Path)

Source from the content-addressed store, hash-verified

198
199
200def _cleanup_api_files(build_dir: Path):
201 """Remove API endpoint files that were created during freezing"""
202 build_path = Path(build_dir)
203
204 # List of files/directories to remove (API endpoints that shouldn't be in static build)
205 cleanup_patterns = [
206 "download-file",
207 "load-log",
208 "load-trajectory-details",
209 "load-trajectory-diffs",
210 "delete-experiment",
211 "batch",
212 "analysis",
213 "picker/api",
214 ]
215
216 for pattern in cleanup_patterns:
217 target = build_path / pattern
218 if target.exists():
219 if target.is_file():
220 target.unlink()
221 print(f" Removed file: {pattern}")
222 elif target.is_dir():
223 shutil.rmtree(target)
224 print(f" Removed directory: {pattern}")
225
226
227def _add_html_extensions(build_dir: Path):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected