Fully resolve a path: resolve env vars ($HOME etc.) -> expand user (~) -> make absolute Args: path (Union[str, Path]): Path to a file or repository to resolve as string or pathlib.Path Returns: pathlib.Path: resolved absolute path
(path: Union[str, Path])
| 32 | |
| 33 | |
| 34 | def resolve_path(path: Union[str, Path]) -> Path: |
| 35 | """ |
| 36 | Fully resolve a path: |
| 37 | resolve env vars ($HOME etc.) -> expand user (~) -> make absolute |
| 38 | |
| 39 | Args: |
| 40 | path (Union[str, Path]): Path to a file or repository to resolve as |
| 41 | string or pathlib.Path |
| 42 | |
| 43 | Returns: |
| 44 | pathlib.Path: resolved absolute path |
| 45 | """ |
| 46 | return Path(expandvars(str(path))).expanduser().resolve() |
| 47 | |
| 48 | |
| 49 | def backup(file_path: Union[str, Path], ext: Optional[str] = ".bak") -> None: |
no outgoing calls
searching dependent graphs…