1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-11 01:54:16 +00:00

feat: Enhance clean and optimize operations with new configuration constants

This commit is contained in:
Tw93
2025-12-18 17:02:04 +08:00
parent 456215f2ff
commit af03452f6d
17 changed files with 504 additions and 483 deletions

View File

@@ -29,7 +29,7 @@ setup() {
mkdir -p "$HOME/.cache/mole"
# Clean any previous test artifacts
rm -rf "$HOME/www"/* "$HOME/dev"/*
rm -rf "${HOME:?}/www"/* "${HOME:?}/dev"/*
}
# =================================================================
@@ -151,7 +151,8 @@ setup() {
source '$PROJECT_ROOT/lib/clean/project.sh'
is_recently_modified '$HOME/www/old-project/node_modules' || true
"
[ "$?" -eq 0 ] || [ "$?" -eq 1 ] # Allow both true/false, just check no crash
local exit_code=$?
[ "$exit_code" -eq 0 ] || [ "$exit_code" -eq 1 ] # Allow both true/false, just check no crash
}
# =================================================================

View File

@@ -97,7 +97,7 @@ clean_time_machine_failed_backups
EOF
[ "$status" -eq 0 ]
[[ "$output" == *"No failed Time Machine backups found"* ]]
[[ "$output" == *"No incomplete backups found"* ]]
}

View File

@@ -0,0 +1,13 @@
# Mole Cleanup Preview - 2025-12-18 17:01:44
#
# How to protect files:
# 1. Copy any path below to ~/.config/mole/whitelist
# 2. Run: mo clean --whitelist
#
# Example:
# /Users/*/Library/Caches/com.example.app
#
=== User essentials ===
/Users/tw93/www/Mole/tests/tmp-clean-home.EmChvN/Library/Caches/TestApp # 4KB