1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-12 14:01:17 +00:00

feat: Expand critical system component protection in clean user logic and apply minor shell script fixes.

This commit is contained in:
Tw93
2025-12-17 20:42:25 +08:00
parent 611254848d
commit 0427dbb6c0
4 changed files with 6 additions and 5 deletions

View File

@@ -51,7 +51,7 @@ is_safe_project_artifact() {
# Must not be a direct child of HOME directory
# e.g., ~/.gradle is NOT safe, but ~/Projects/foo/.gradle IS safe
local relative_path="${path#$search_path/}"
local relative_path="${path#"$search_path"/}"
local depth=$(echo "$relative_path" | tr -cd '/' | wc -c)
# Require at least 1 level deep (inside a project folder)
@@ -323,6 +323,7 @@ clean_project_artifacts() {
# Set up cleanup on interrupt
local scan_pids=()
local scan_temps=()
# shellcheck disable=SC2329
cleanup_scan() {
# Kill all background scans
for pid in "${scan_pids[@]}"; do