1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 19:40:07 +00:00

fix(purge): avoid command find in fallback scan (#478)

This commit is contained in:
tw93
2026-02-23 08:15:47 +08:00
parent 8f5b70457e
commit 1169cbf198

View File

@@ -504,7 +504,9 @@ scan_purge_targets() {
[[ $i -lt $((${#purge_targets[@]} - 1)) ]] && target_expr+=(-o)
done
command find "$search_path" -mindepth "$min_depth" -maxdepth "$max_depth" -type d \
# Use plain `find` here for compatibility with environments where
# `command find` behaves inconsistently in this complex expression.
find "$search_path" -mindepth "$min_depth" -maxdepth "$max_depth" -type d \
\( "${prune_expr[@]}" \) -prune -o \
\( "${target_expr[@]}" \) -print -prune \
2> /dev/null > "$output_file.raw" || true