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

feat: Enhance app protection with centralized critical component checks, improve UI string width calculation, refine analysis and cleaning logic, and add new tests.

This commit is contained in:
Tw93
2025-12-22 11:24:04 +08:00
parent 5c6e643b0c
commit d2dc68da90
16 changed files with 270 additions and 102 deletions

View File

@@ -484,10 +484,17 @@ clean_project_artifacts() {
local path="$1"
# Find the project root by looking for direct child of search paths
local search_roots=("$HOME/www" "$HOME/dev" "$HOME/Projects")
local search_roots=()
if [[ ${#PURGE_SEARCH_PATHS[@]} -gt 0 ]]; then
search_roots=("${PURGE_SEARCH_PATHS[@]}")
else
search_roots=("$HOME/www" "$HOME/dev" "$HOME/Projects")
fi
for root in "${search_roots[@]}"; do
if [[ "$path" == "$root/"* ]]; then
# Normalize trailing slash for consistent matching
root="${root%/}"
if [[ -n "$root" && "$path" == "$root/"* ]]; then
# Remove root prefix and get first directory component
local relative_path="${path#"$root"/}"
# Extract first directory name