Function
_copy_file
(src: Path, dest: Path, dry_run: bool)
Source from the content-addressed store, hash-verified
| 209 | |
| 210 | |
| 211 | def _copy_file(src: Path, dest: Path, dry_run: bool) -> None: |
| 212 | if not src.exists(): |
| 213 | print(f" WARNING: source not found: {src}", file=sys.stderr) |
| 214 | return |
| 215 | if dry_run: |
| 216 | print(f" [dry-run] copy {src} -> {dest}") |
| 217 | return |
| 218 | dest.parent.mkdir(parents=True, exist_ok=True) |
| 219 | shutil.copy2(src, dest) |
| 220 | print(f" Copied {dest}") |
| 221 | |
| 222 | |
| 223 | def _append_with_markers(path: Path, content: str, dry_run: bool) -> None: |
Tested by
no test coverage detected