Remove all items from the cache.
(*, config_file, profile, output)
| 1302 | @config_file_options() |
| 1303 | @standardized_output |
| 1304 | def cache_purge(*, config_file, profile, output): |
| 1305 | """Remove all items from the cache.""" |
| 1306 | |
| 1307 | config = validate_config_v1(load_config(config_file=config_file, profile=profile)) |
| 1308 | info = _get_cache_info(config) |
| 1309 | |
| 1310 | for name, collection in info.items(): |
| 1311 | for stats in collection: |
| 1312 | path: Path = stats['path'] |
| 1313 | if path.is_file(): |
| 1314 | path.unlink() |
| 1315 | else: |
| 1316 | shutil.rmtree(path) |
| 1317 | |
| 1318 | output("Cache purged.") |
| 1319 | |
| 1320 | |
| 1321 | @cli.group() |
nothing calls this directly
no test coverage detected