INNER CODE UNIT · Python
prepare_output_dir
epigen/MrBiomics · helpers/MrBiomics_context_crawler.py:292
def prepare_output_dir(root: Path, dry_run: bool) -> Path:
folder_name = f"MrBiomics_AI_resources"
target_dir = (root / folder_name).resolve()
if dry_run:
print(f"[dry-run] Would create directory {target_dir}")
else:
target_dir.mkdir(parents=True, exist_ok=True)
return target_dir
def write_text(path: Path, content: str, dry_run: bool) -> None:
if dry_run:
print(f"[dry-run] Would write {path} ({len(content)} characters)")
return
path.write_text(content, encoding="utf-8")
print(f"Wrote {path} ({len(content)} characters)")