File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1+ from os import statvfs
12from pathlib import Path
23
34from mac_cleanup .config import Config
45from mac_cleanup .console import console , print_panel
56from mac_cleanup .core import _Collector
67from mac_cleanup .error_handling import catch_exception
78from mac_cleanup .parser import args
8- from mac_cleanup .utils import bytes_to_human , cmd
9+ from mac_cleanup .utils import bytes_to_human
910
1011
1112class EntryPoint :
@@ -16,7 +17,8 @@ class EntryPoint:
1617 def count_free_space () -> float :
1718 """Get current free space."""
1819
19- return float (cmd ("df / | tail -1 | awk '{print $4}'" ))
20+ s_fs = statvfs ("/" )
21+ return float (s_fs .f_bavail * s_fs .f_frsize / s_fs .f_bsize )
2022
2123 def cleanup (self ) -> None :
2224 """Launch cleanup and print results."""
You can’t perform that action at this time.
0 commit comments