MCPcopy Create free account
hub / github.com/claw-bench/claw-bench / write_task_files

Function write_task_files

scripts/generate_task_from_proposal.py:574–594  ·  view source on GitHub ↗

Write generated files to disk. Returns list of created file paths.

(files: dict[str, str], dry_run: bool = False)

Source from the content-addressed store, hash-verified

572
573
574def write_task_files(files: dict[str, str], dry_run: bool = False) -> list[str]:
575 """Write generated files to disk. Returns list of created file paths."""
576 created = []
577 for rel_path, content in files.items():
578 full_path = PROJECT_ROOT / rel_path
579 if dry_run:
580 print(f" [DRY RUN] Would create: {rel_path}")
581 created.append(rel_path)
582 continue
583
584 full_path.parent.mkdir(parents=True, exist_ok=True)
585 full_path.write_text(content)
586
587 # Make shell scripts executable
588 if full_path.suffix == ".sh":
589 full_path.chmod(0o755)
590
591 created.append(rel_path)
592 print(f" Created: {rel_path}")
593
594 return created
595
596
597# ---------------------------------------------------------------------------

Callers 1

mainFunction · 0.85

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected