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

fix(purge): use regex OR pattern instead of multiple -g flags for fd

This commit is contained in:
Jack Phallen
2026-01-01 22:45:30 -08:00
parent 78ded00847
commit 5e7f276722

View File

@@ -307,6 +307,10 @@ scan_purge_targets() {
return
fi
if command -v fd > /dev/null 2>&1; then
local pattern="($(
IFS='|'
echo "${PURGE_TARGETS[*]}"
))"
local fd_args=(
"--absolute-path"
"--hidden"
@@ -320,10 +324,7 @@ scan_purge_targets() {
"--exclude" ".Trash"
"--exclude" "Applications"
)
for target in "${PURGE_TARGETS[@]}"; do
fd_args+=("-g" "$target")
done
fd "${fd_args[@]}" . "$search_path" 2> /dev/null | while IFS= read -r item; do
fd "${fd_args[@]}" "$pattern" "$search_path" 2> /dev/null | while IFS= read -r item; do
if is_safe_project_artifact "$item" "$search_path"; then
echo "$item"
fi