mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 15:39:42 +00:00
fix: remove insecure empty folder cleanup logic to prevent critical data loss (#320)
- Removes clean_empty_library_items functionality that incorrectly deleted critical paths (e.g., Postgres data, Steam locks) - Cleans up associated tests and unnecessary protection rules - Ensures empty folders are preserved by default for safety
This commit is contained in:
@@ -103,21 +103,7 @@ EOF
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "clean_empty_library_items cleans empty dirs and files" {
|
||||
run env HOME="$HOME" PROJECT_ROOT="$PROJECT_ROOT" /bin/bash --noprofile --norc <<'EOF'
|
||||
set -euo pipefail
|
||||
source "$PROJECT_ROOT/lib/core/common.sh"
|
||||
source "$PROJECT_ROOT/lib/clean/user.sh"
|
||||
safe_clean() { echo "$2"; }
|
||||
WHITELIST_PATTERNS=()
|
||||
mkdir -p "$HOME/Library/EmptyDir"
|
||||
touch "$HOME/Library/empty.txt"
|
||||
clean_empty_library_items
|
||||
EOF
|
||||
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" == *"Empty Library folders"* ]]
|
||||
}
|
||||
|
||||
@test "clean_browsers calls expected cache paths" {
|
||||
run env HOME="$HOME" PROJECT_ROOT="$PROJECT_ROOT" bash --noprofile --norc <<'EOF'
|
||||
|
||||
Reference in New Issue
Block a user