Skip to content

Commit

Permalink
Skip checking already excluded directories
Browse files Browse the repository at this point in the history
Using `mdfind` since it's fast, yet it may not return all excluded directories

Kinda fixes stevegrunwell#68
  • Loading branch information
VladRassokhin committed Oct 23, 2024
1 parent cdcc502 commit 33be47c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions asimov
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ declare -a find_parameters_skip=()
for d in "${ASIMOV_SKIP_PATHS[@]}"; do
find_parameters_skip+=( -not \( -path "${d}" -prune \) )
done
# Collect already excluded directories to not descent into them
while IFS= read -r line
do
find_parameters_skip+=( -not \( -path "${line}" -prune \) )
done < <(mdfind -onlyin "${ASIMOV_ROOT}" com_apple_backup_excludeItem = 'com.apple.backupd' | sort | uniq)

# Iterate over the directory/sentinel pairs to construct the `find` expression.
declare -a find_parameters_vendor=()
Expand Down

0 comments on commit 33be47c

Please sign in to comment.