Skip to content

Commit e03decc

Browse files
committed
fix: enhance logging in clean command to report freed space
1 parent dece790 commit e03decc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

killpy/commands/clean.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1+
import logging
12
from pathlib import Path
23

34
import click
45

56
from killpy.cleaners import remove_pycache
7+
from killpy.files import format_size
68

79

810
@click.command()
911
@click.option("--path", default=Path.cwd(), help="Path to the directory to clean")
1012
def clean(path):
1113
path = Path(path)
12-
click.echo(f"Executing the clean command in {path}")
13-
remove_pycache(path)
14+
logging.info(f"Executing the clean command in {path}")
15+
total_freed_space = remove_pycache(path)
16+
logging.info(f"{format_size(total_freed_space)} deleted")

0 commit comments

Comments
 (0)