1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 19:40:07 +00:00

fix: preserve interrupt semantics and restore purge traps

This commit is contained in:
tw93
2026-02-27 11:18:53 +08:00
parent 194fe871e5
commit a9433e4acd
5 changed files with 81 additions and 0 deletions

View File

@@ -249,6 +249,11 @@ safe_remove() {
local rm_exit=0
error_msg=$(rm -rf "$path" 2>&1) || rm_exit=$? # safe_remove
# Preserve interrupt semantics so callers can abort long-running deletions.
if [[ $rm_exit -ge 128 ]]; then
return "$rm_exit"
fi
if [[ $rm_exit -eq 0 ]]; then
# Log successful removal
log_operation "${MOLE_CURRENT_COMMAND:-clean}" "REMOVED" "$path" "$size_human"