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

feat: Improve clean command's regex handling and pnpm cache cleaning, enhance test output, update completion descriptions, and clarify installation instructions.

This commit is contained in:
Tw93
2026-01-02 18:50:42 +08:00
parent 09286f8ff9
commit 910e79df4e
5 changed files with 20 additions and 10 deletions

View File

@@ -307,9 +307,14 @@ scan_purge_targets() {
return
fi
if command -v fd > /dev/null 2>&1; then
# Escape regex special characters in target names for fd patterns
local escaped_targets=()
for target in "${PURGE_TARGETS[@]}"; do
escaped_targets+=("$(printf '%s' "$target" | sed -e 's/[][(){}.^$*+?|\\]/\\&/g')")
done
local pattern="($(
IFS='|'
echo "${PURGE_TARGETS[*]}"
echo "${escaped_targets[*]}"
))"
local fd_args=(
"--absolute-path"