Skip to content

Commit 47ffb18

Browse files
author
root
committed
chore: add guard check to secure temp directory cleanup
1 parent be5bb97 commit 47ffb18

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

private/tools/diff.bash

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ on_exit() {
2222
fi
2323
fi
2424
pkill -P $$ || true
25-
rm -rf "$SECURE_TMP"
25+
26+
# Robust cleanup with existence guard
27+
if [[ -n "${SECURE_TMP:-}" && -d "$SECURE_TMP" ]]; then
28+
rm -rf "$SECURE_TMP"
29+
fi
2630
}
2731
trap "on_exit" EXIT
2832

0 commit comments

Comments
 (0)