1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-11 05:24:19 +00:00

Parallel scanning and testing

This commit is contained in:
Tw93
2025-12-11 19:24:23 +08:00
parent d5f36e1e9a
commit 2d7932025f
4 changed files with 62 additions and 78 deletions

View File

@@ -10,7 +10,7 @@ clean_user_essentials() {
safe_clean ~/.Trash/* "Trash"
# Empty trash on mounted volumes
if [[ -d "/Volumes" ]]; then
if [[ -d "/Volumes" && "$DRY_RUN" != "true" ]]; then
for volume in /Volumes/*; do
[[ -d "$volume" && -d "$volume/.Trashes" && -w "$volume" ]] || continue
@@ -23,7 +23,6 @@ clean_user_essentials() {
# Verify volume is mounted and not a symlink
mount | grep -q "on $volume " || continue
[[ -L "$volume/.Trashes" ]] && continue
[[ "$DRY_RUN" == "true" ]] && continue
# Safely iterate and remove each item
while IFS= read -r -d '' item; do