1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 19:09:43 +00:00

Safety reinforcement

This commit is contained in:
Tw93
2025-12-03 21:20:28 +08:00
parent 53bec36ebf
commit 54bbbcce47
3 changed files with 6 additions and 6 deletions

View File

@@ -273,7 +273,7 @@ safe_clean() {
local size
size=$(get_path_size_kb "$path")
local count
count=$(find -- "$path" -type f 2> /dev/null | wc -l | tr -d ' ')
count=$(find "$path" -type f 2> /dev/null | wc -l | tr -d ' ')
# Use index + PID for unique filename
local tmp_file="$temp_dir/result_${idx}.$$"
echo "$size $count" > "$tmp_file"
@@ -332,7 +332,7 @@ safe_clean() {
local size_bytes
size_bytes=$(get_path_size_kb "$path")
local count
count=$(find -- "$path" -type f 2> /dev/null | wc -l | tr -d ' ')
count=$(find "$path" -type f 2> /dev/null | wc -l | tr -d ' ')
if [[ "$count" -gt 0 && "$size_bytes" -gt 0 ]]; then
if [[ "$DRY_RUN" != "true" ]]; then