(root: pathlib.Path, relative_path: str)
| 64 | |
| 65 | |
| 66 | def to_workspace_path(root: pathlib.Path, relative_path: str) -> pathlib.Path: |
| 67 | posix_path = pathlib.PurePosixPath(relative_path) |
| 68 | if posix_path.is_absolute() or ".." in posix_path.parts: |
| 69 | raise ValueError(f"invalid sync path: {relative_path}") |
| 70 | return root.joinpath(*posix_path.parts) |
| 71 | |
| 72 | |
| 73 | def sync_files( |