File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1
1
import logging
2
+ import shutil
2
3
import sys
3
4
import time
4
5
from collections import Counter
@@ -369,3 +370,23 @@ def run(
369
370
if allow_errors < total_errors :
370
371
logger .debug ("number of allowed errors %i was exceeded" )
371
372
sys .exit (1 )
373
+
374
+
375
+ @cli .command ()
376
+ @click .option ("-v" , "--verbose" , count = True , help = "Print more details (repeatable)." )
377
+ @click .help_option ("-h" , "--help" )
378
+ def clean (verbose ):
379
+ """Clean the cache.
380
+
381
+ Looks for a cache directory relative to the current working directory.
382
+ If one exists, remove it.
383
+ """
384
+ _setup_logging (verbose = verbose )
385
+
386
+ path = _cache_dir_in_cwd ()
387
+ if path .exists ():
388
+ assert path .is_dir ()
389
+ shutil .rmtree (_cache_dir_in_cwd ())
390
+ logger .info ("cleaned %s" , path )
391
+ else :
392
+ logger .info ("no cache to clean" )
You can’t perform that action at this time.
0 commit comments