(pattern)
| 88 | |
| 89 | |
| 90 | def delete_glob(pattern): |
| 91 | # Path.glob doesn't accept non-relative patterns. |
| 92 | for path in glob(str(pattern)): |
| 93 | path = Path(path) |
| 94 | print(f"Deleting {path} ...") |
| 95 | if path.is_dir() and not path.is_symlink(): |
| 96 | shutil.rmtree(path) |
| 97 | else: |
| 98 | path.unlink() |
| 99 | |
| 100 | |
| 101 | def subdir(*parts, create=False): |